Announcement

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

  • LASSO with mi estimate:

    Hello,

    I am fairly new to Stata. I use Stata 14.1.

    I wish to perform LASSO with my data and was able to do this with my data with the following code using the LARS program:

    Code:
    lars prevdis agegroupnew tbpast hiv cough nutritionstatusnew familysize cavtindx windcat relativenew bcg1 indagenew if indagenew<10 & case<3 & windcat<10  & hiv<10 & tbpast<10 & agegroupnew<10 & cough<10 & cavtindx<10 & nutritionstatusnew<10, a(lasso) g
    However when I used multiple imputation to take care of missing value this command no longer worked. See below:

    Code:
    mi set wide
    mi register impute hiv cough cavtindx relativenew tbpast prevdis
    mi describe
    set seed 8945
    mi impute chained (logit) cough (mlogit) hiv tbpast windcat cavtindx = prevdis familysize indagenew if case<3, add(10)
    
    mi estimate: lars price weight length mpg turn rep78 headroom trunk displacement gear_ratio foreign, a(lasso) g
    After this I get the following error:
    Code:
    . mi estimate: lars prevdis agegroupnew tbpast hiv cough nutritionstatusnew familysize cavtindx windcat relativenew bcg1 indagenew if indagenew<10 & case<3 & windcat<10  &
    >  hiv<10 & tbpast<10 & agegroupnew<10 & cough<10 & cavtindx<10 & nutritionstatusnew<10, a(lasso) g
    mi estimate: command not supported
        lars is not officially supported by mi estimate; see mi estimation for a list of Stata estimation commands that are supported by mi estimate.  You can use option
        cmdok to allow estimation anyway.
    r(198);
    I attempted to use the cmdok command with mi estimate in order to force the situation and it again gives an error.

    Code:
    . mi estimate, cmdok: lars prevdis agegroupnew tbpast hiv cough nutritionstatusnew familysize cavtindx windcat relativenew bcg1 indagenew if indagenew<10 & case<3 & windca
    > t<10  & hiv<10 & tbpast<10 & agegroupnew<10 & cough<10 & cavtindx<10 & nutritionstatusnew<10, a(lasso) g
    macro e(cmd) is not set
    matrix e(b) is not set
    matrix e(V) is not set
    r(301);
    Is there a way to perform LASSO with multiple imputation on Stata?

    Thank you for any help you can provide!

    Best,
    Leo






  • #2
    I did some more looking and found this link to a previous question posted in 2009:

    http://www.stata.com/statalist/archi.../msg00555.html

    They seem to state the same problem that I am having.


    Comment

    Working...
    X