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:
However when I used multiple imputation to take care of missing value this command no longer worked. See below:
After this I get the following error:
I attempted to use the cmdok command with mi estimate in order to force the situation and it again gives an error.
Is there a way to perform LASSO with multiple imputation on Stata?
Thank you for any help you can provide!
Best,
Leo
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
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
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);
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);
Thank you for any help you can provide!
Best,
Leo
Comment