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
empty model in mulitple imputations framework (mixed models)Dear all, I am currently analyzed data with missing data. In complete case analysis framework, the…
Generate Leads and LagsI would like to create leads and lags to control for the last two years before a pollical leader cam…
Code for bootstrapped CI for inference about mediationDear Statalists, below I have run a Monte Carlo simulation in order to obtain CI's which I can use …
Creation of count variables that relate to a period of timeHey everybody, I am Till from Germany and new with Stata and using it for my master thesis. Current…
Does STATA use robust standard errors for logistic regression?Hi, The title says it all really. Since logistic regression by its nature is heteroskedastic, does …
Subscribe to:
Post Comments (Atom)
0 Response to Loop function
Post a Comment