»  Home »  Products »  Features »  Lasso


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.

Learn about lasso in Stata.

See what's new in lasso.

Lasso for prediction and model selection

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

Lasso for inference

  • Effect estimates for covariates of interest
  • Coefficients, SEs, tests, confidence intervals
  • Robust and cluster–robust SEs New
  • 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
  • Treatment effects New

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

Selection methods

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

Additional resources

See New in Stata 17 to learn about what was added in Stata 17.





The Stata Blog: Not Elsewhere Classified Find us on Facebook Follow us on Twitter LinkedIn YouTube Instagram
© Copyright 1996–2022 StataCorp LLC   •   Terms of use   •   Privacy   •   Contact us