Dear everyone,
I have trouble when create a loop to generate a new variable for my dataset. My data is presented as below.
For subset of data that var Y =1, I want to create a new_var for each industry(sic) such that new_var in year t = total value of X from year t+1 to t+3.
I a new beginner in Stata and I think that I should work with loop. I try but still can not find a solution for that.
Can anyone help me? I am really appreciate for that. Thank you so much
Related Posts with Loops within loops
AFT or Cox survival analysis for buy-build strategies in private equity duration analysesHi there, For my research project I am analysing the duration of private equity buy-and-build strat…
multi-level/mixed effects vs clustered robust standard errors - which is more appropriate if many of the clusters have 1 individual?Hi. I have a dataset of psychological measures from carers (n=254) of people with mental health pat…
How to invert the order of rows in a matrixDear Statalisters Apologies in advance for the simplicity of my question. I am sure the is already …
Stata 16 does not export decimal points to ExcelI am facing this problem in Stata 16. When I export data to Excel using Stata 16, the decimal points…
Appending the same .dta-file many timesHello, I am using Stata/SE 15.1 for Mac. I would like to use the append-command to build up a datas…
Subscribe to:
Post Comments (Atom)
0 Response to Loops within loops
Post a Comment