I have data which resembles the following:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double(y x1 x2 year)
2 2 2 1991
3 3 3 1990
1 4 4 1990
4 1 1 1991
1 2 2 1990
4 3 3 1990
end
[/CODE]
Here, I wish to run a lasso regression of y on x1, x2 and year dummies, in order to select relevant regressors (between x1 and x2 in this example). In order to do this, I run:
Code:
lasso2 y x1 x2 (year) , lic(aicc) long
1. How can I force the model to include all year dummies in this case, and only select between x1 and x2?
2. How can I store the variable list which is selected in a local macro for use at a later point?
Many thanks for your consideration.
CS
0 Response to Selected variable list using lasso
Post a Comment