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
Alternative to inlist() - expression too longHi, Relatively basic question: I am looking for a concise (1 line) alternative to inlist that would…
[Beginner] How to do identify the 2 groups after Propensity Score Matching?Dear All, apologies I am really new to statistics and Stata but I need to conduct a Propensity Scor…
r(132) too few quotesHi all, For the life of me I cannot figure out where the error lies in my code. I was hoping a seco…
Save mi estimate results as datasetI'd like to run mi estimate over different subsets of data, and save the resulting estimates to anot…
Time Series: how to obtain a date variable collapsing year and month (dm)?I have time series data of an index of employment in Brazilian industries. Part of the data is repro…
Subscribe to:
Post Comments (Atom)
0 Response to Loops within loops
Post a Comment