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
Panel dataHi everyone, Need help with analysing this data. A description of the data: Individuals are biannua…
esttab output format for mixed interaction modelsDear Statalist, I need output the mixed interaction effects using esttab. However, I have two model…
How to subset my dataset based on multiply string filters?My data set is very big, so I copy and paste the first 15 rows as a new exemple excel file. Code: …
omitted categories among the results of the linear fixed effect regressioinsDear All: I am writing a simple linear regression. I have the following code: reg y i.fourthq##i.typ…
Comparing two coefficients in GMMDear Stata users, I am using the Difference and System GMM approach for estimation and I want to co…
Subscribe to:
Post Comments (Atom)
0 Response to Loop function
Post a Comment