With Stata’s lasso and elastic net features, you can perform model selection and prediction for your continuous, binary, and count outcomes. Want to estimate effects and test coefficients? With cutting-edge inferential methods, you can make inferences for variables of interest while lassos select control variables for you. You can even account for endogenous covariates.


LASSO FOR PREDICTION AND MODEL SELECTION

  • Lasso
  • Elastic net
  • Square-root lasso
  • Continuous, binary, count, and survival-time outcomes
  • Clustered data

 

LASSO FOR INFERENCE

  • Effect estimates for covariates of interest
  • Coefficients, SEs, tests, confidence intervals
  • Robust and cluster–robust SEs
  • Lasso selects control variables
  • Robust to model-selection mistakes by lasso
  • Double selection
  • Partialing out
  • Cross-fit partialing out
  • Double machine learning (DML1 and DML2)
  • Linear, logit, and Poisson regression
  • Endogenous covariates in linear models
  • Causal inference/Treatment effects

 

BAYESIAN LASSO

 

DATA PREPARATION

  • Divide data into random samples
  • Manage large lists of variables
    • Create names for referring to
      • All continuous variables
      • All categorical variables
      • Your own variable groupings

 

© Copyright 1996–2024 StataCorp LLC. All rights reserved.

SELECTION METHODS

  • Cross-validation
  • Adaptive lasso
  • Plugin iterative formula
  • Bayesian information criterion (BIC)
  • Select your own

 

EVALUATE SELECTED MODEL

  • Graphs
    • Cross-validation function plot
    • Coefficient paths
  • Goodness of fit
    • Mean squared error of prediction
    • In-sample and out-of-sample R-squareds
    • Deviance
    • In-sample and out-of-sample deviance ratios
    • BIC
    • Relative L1-norm of coefficients
    • Relative L2-norm squared of coefficients
  • Estimated coefficients
    • Penalized
    • Postselection

 

coefpath_stcolor.svg