Announcement

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

  • Inconsistent results from lasso estimations (even with set seed)

    Hi everyone,

    Could you please let me know why the result of the second estimation differs from the result of the first estimation?

    Code:
    sysuse auto, clear
    
    set seed 1234
    lasso probit foreign c.mpg##c.headroom##c.length
    predict oo
    
    
    lasso probit foreign c.mpg##c.headroom##c.length
    predict vv
    
    
    su oo
    su vv
    I get the following output for them:

    Code:
    su oo
    
        Variable |        Obs        Mean    Std. dev.       Min        Max
    -------------+---------------------------------------------------------
              oo |         74    .2906908    .2184906   .0137683   .7993348
    
    su vv
    
        Variable |        Obs        Mean    Std. dev.       Min        Max
    -------------+---------------------------------------------------------
              vv |         74    .2908553    .2235728    .011889   .8105715
    Thank you,
    Gabor
    Last edited by Gabor Mugge; 15 Feb 2023, 05:50.

  • #2
    I'm sorry, this doesn't actually preproduce the problem that I wanted to reproduce.

    Comment


    • #3
      You need to set the seed again before your second lasso.

      Comment

      Working...
      X