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
Random Effects vs Fixed Effects model issues with Hausman Test (V_b Vb not positive definite)Dear Statalister, I have an unbalanced panel dataset for 5817 (N) firms per 8 years (T). I'm runnin…
Problem with summarystatistics by groupDear all, In my dataset I have 5 dummies, indicating whether a firm belongs to a specific group. I …
Error rdplotI have a problem regarding a regression discontinuity design. I use panel data, where I have two yea…
Estimating p-value from t-value in regression with cluster-robust standard errorsHi, I have run a regression model with cluster-robust standard errors, using the following command:…
Drop many variables with same answer in the observationsHi, I'm working with a database from a University. In the observations there are a lot of variables …
Subscribe to:
Post Comments (Atom)
0 Response to Loops within loops
Post a Comment