I run a lasso for inference model using double selection:
dsregress depvar i.variable_of_interest1 i.variable_of_interest2, controls($cont i.($cat)) rseed(12345)
And store the estimates:
estimates store ds_plugin
I can look at the controls selected for the dependent variable:
lassocoef(ds_plugin, for (dapvar))
What I would like to do is look at the controls selected for the variables of interest - so at the moment I am writing:
lassocoef(ds_plugin, for (variable_of_interest1))
However I get an error with this:
can not find result for variable_of_interest1
r(111)
I am inputting the same code as in the lasso manual so am unsure why it is not working for me. If anyone could explain that would be really helpful
Related Posts with How to get controls selected for the variables of interest using lasso for inference
Identify All Values in One Variable that Satisfies a ConditionHi Statalist members, I encounter a difficulty in identifying values in one variable that satisfies…
Saving file name as local valueDear Stata Professionals I am currently suffering from saving file name as local value The code I …
Reshaping data to SUR formDear Everybody I'm trying to run a SUR regression and need to reshape my data accordingly. The data…
How do I replace a certain value across a dataset that has string as well as numeric variables?Hi everyone, I'm working with a dataset that has hundreds of variables, numeric as well as strings.…
Interpreting psgraph ftaer psmatch2I am employing propensity score matching using community-contributed psmatch2 command. To check for …
Subscribe to:
Post Comments (Atom)
0 Response to How to get controls selected for the variables of interest using lasso for inference
Post a Comment