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
dbs: Stata command for computing double bootstrap confidence intervalsDear all, I am happy to announce a new Stata command, dbs, which allows the computation of double bo…
Time DummyWhat is the command to test the before and after effect of a phenomenon, example price rise . The ye…
return list in "ineqdeco" command (user-wrriten)Hi, I am suffering from a problem. I want get the results when I run "ineqdeco" command, but I can't…
6 groups in one graphHello everyone, I want to have a graph with 6 groups in it. I am able to produce a graph with 6 sm…
a question on exporting data from stataHello all, This question is a bit convoluted, so please bear with me. I am working with Supreme Co…
Subscribe to:
Post Comments (Atom)
0 Response to Loop function
Post a Comment