Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Stata 16 Lasso and ROC curves

    I have a binary outcome "Y," and I'm running Stata 16's Lasso regression commands (linear and logit). Specifically, I'm estimating two Lasso models and would like to compare their ROC curves (sample code below).

    Can I use roctab and roccomp after Lasso regressions? The manual for roctab and roccomp only gives examples for logit and probit regressions, and it is unclear to me whether I can use roctab and roccomp after Lasso linear/logit regressions.

    I'm new to both Lasso regressions and ROC curves, so your help would be very helpful! Thank you!


    Code:
    *Model 1
    lasso linear y x1 if training_sample==1, selection(cv, folds(10)) rseed(621)
    predict predicted_y1
    roctab y predicted_y1
    
    *Model 2
    lasso linear y x1 x2 if training_sample==1, selection(cv, folds(10)) rseed(621)
    predict predicted_y2
    roctab y predicted_y2
    
    *Compare ROC curves of Model 1 and Model 2
    roccomp y predicted_y1 predicted_y2

  • #2
    roctab and roccomp are not currently supported after lasso regression. We are looking into this functionality though. Thank you for your feedback.

    Comment


    • #3
      As an update from 2021 - I tested roctab today after Lasso, and it was functional.

      Comment

      Working...
      X