Hello,
I want to generate following:
gen capm1 = rmrf if decile == 1
and this 10x times, basically until
gen capm10 = rmrf if decile == 10
Do I have to type this in 10x myself or can I use foreach? Is foreach possible with function gen, because the variablename has to change every time?
At the end I would also like to form 10 regressions looking like this, which is perhaps more possible with foreach? :
reg decile1 capm1 until reg decile10 capm10
Related Posts with Loop function
Interpreting regression coefficients with min-max scalingHi, I am running a regression with indices. Dependent variable is overall index while independent v…
How to run independence test on 3 categorical variables on Stata?I'm working on descriptive analysis and wish to compare 3 categorical variables: Sex (man / woman) …
Stata Regression YearsHi all, I looked at a sample of companies and their balance sheets from 2014 to 2017. To do this, I…
Unrealistic R squared in LSDV modelHello everybody, Situation: I use Stata 14.2. I want to investigate the effects of mobile phone pen…
100% sensitivity in my estat test, no data classified as negative & I'm only seeing 16/1771 case on my roc print out and scatterplotGood afternoon, When I run my logistic regression, everything comes out OK with no strange data. Ho…
Subscribe to:
Post Comments (Atom)
0 Response to Loop function
Post a Comment