Hello Forum Members,
I have loaded my 'DATA' file and I seek to run all of these models on a simple regression.
CAT = X1 + X2, for CAT1 = 1 and CAT2 = 1
CAT = X1 + X2, for CAT1 = 2 and CAT2 = 1
CAT = X1 + X2, for CAT1 = 3 and CAT2 = 1
CAT = X1 + X2, for CAT1 = 4 and CAT2 = 1
CAT = X1 + X2, for CAT1 = 1 and CAT2 = 2
CAT = X1 + X2, for CAT1 = 2 and CAT2 = 2
CAT = X1 + X2, for CAT1 = 3 and CAT2 = 2
CAT = X1 + X2, for CAT1 = 4 and CAT2 = 2
DOG = X1 + X2, for CAT1 = 1 and CAT2 = 1
DOG = X1 + X2, for CAT1 = 2 and CAT2 = 1
DOG = X1 + X2, for CAT1 = 3 and CAT2 = 1
DOG = X1 + X2, for CAT1 = 4 and CAT2 = 1
DOG = X1 + X2, for CAT1 = 1 and CAT2 = 2
DOG = X1 + X2, for CAT1 = 2 and CAT2 = 2
DOG = X1 + X2, for CAT1 = 3 and CAT2 = 2
DOG = X1 + X2, for CAT1 = 4 and CAT2 = 2
FROG = X1 + X2, for CAT1 = 1 and CAT2 = 1
FROG = X1 + X2, for CAT1 = 2 and CAT2 = 1
FROG = X1 + X2, for CAT1 = 3 and CAT2 = 1
FROG = X1 + X2, for CAT1 = 4 and CAT2 = 1
FROG = X1 + X2, for CAT1 = 1 and CAT2 = 2
FROG = X1 + X2, for CAT1 = 2 and CAT2 = 2
FROG = X1 + X2, for CAT1 = 3 and CAT2 = 2
FROG = X1 + X2, for CAT1 = 4 and CAT2 = 2
My attempt to do it is right here:
foreach OUT in CAT DOG FROG {
for values CAT1 = 1/4 { forvalues CAT2 = 1/2 {
regress `OUT' X1 X2 if CAT1 = CAT1 & CAT2 = CAT2 }}}
But when I do this actually I do not get all of the models. I should end with 24 but only get 8. Where do I improve it?
Related Posts with Run Many Regressions
graph hbox qsHey guys, i have a question about relabel function, so here is my command graph hbox age, over…
Multinomial fractional response model in panel data Hello all! I am mainly working in the context of rural non-farm sector diversification. Thus, i wan…
Help Interpreting Results from regress function with unbalanced panel dataHello! First post here, will do my best to follow all FAQ rules. I am working on a project with a d…
Interpreting main effects model with omitted interaction termsSuppose I have two regressors, task availability (Xa) and task participation (Xp), and a DV Y. One c…
importing dataset with long variables names into stata through loop statementsDear Stata Users, I am trying to import dataset below into stata from csv Array but some variable n…
Subscribe to:
Post Comments (Atom)
0 Response to Run Many Regressions
Post a Comment