Announcement

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

  • loop for any combinations possible for a regression

    Hello everybody.

    I want to estimate a dependent variable on the permutations of the independent variables. In my case, I want to run a regression of y on k number of regressors giving 2^k models. for example, we have y and x1, x2, x3. I want to create a loop where I can estimate:

    Y= C(constant) Y= C + X1 Y= C+ X2 Y= C+X3 Y= C+ X1+X2 Y= C+ X1+X3 Y= C+ X2+X3 Y= C+ X1+X2+X3

    and store the R^2, AIC, and SIC for each model and specification. Please, I would be grateful if I can be directed on how to go about this on Stata.

    Thanks in advance!
Working...
X