The way I imagined this working best is running the models in the outer loop, IV’s in the middle, and the DV in the inner loop, to be specific:
Outer Loop: The three models I want to test are Pooled OLS, Fixed Effects GLS, and Random Effects GLS.
Middle Loop: I want to test three independent variables (with the names IUI, IUI2, PUI) in combination with a list of control variable
Inner Loop: A set of six different dependant variables.
I tried to code the three loops, but I get various errors. I think, I have figured the outer and middle loop out.
foreach reg in "reg" "xtreg" "xtreg,fe" {
foreach regressor in "IUI" "IUI2" "PUI" {
?
}
}
So here's the question: How to (exactly) write the commands, I know I could also put IUI, IUI2 and PUI together into a local macro, but that wouldn't change the underlying loops.
Btw. I hope to find a correlation between Internet Use Intensity and Happiness in China
Thanks!
Outer Loop: The three models I want to test are Pooled OLS, Fixed Effects GLS, and Random Effects GLS.
Middle Loop: I want to test three independent variables (with the names IUI, IUI2, PUI) in combination with a list of control variable
Inner Loop: A set of six different dependant variables.
I tried to code the three loops, but I get various errors. I think, I have figured the outer and middle loop out.
foreach reg in "reg" "xtreg" "xtreg,fe" {
foreach regressor in "IUI" "IUI2" "PUI" {
?
}
}
So here's the question: How to (exactly) write the commands, I know I could also put IUI, IUI2 and PUI together into a local macro, but that wouldn't change the underlying loops.
Btw. I hope to find a correlation between Internet Use Intensity and Happiness in China

Thanks!
Comment