Hi all,
If I have data of 100 firms for 10 years with three variables; and I want to make a dummy variable equal to 1 for the firm if the value of variable x1 in year1 or year2 or year3 not equal to zero; how do I do it?
Probably I need something like: by id, gen boom=1 if x12000 !=0 | x12001 !=0 | x12002 !=0, but obviously there is no variable x!2000 etc. Thank you for your help.
Abdan
Related Posts with Creating dummy based on variable value in subset year
formula into regressionHi Is there any way to make a regression in this way regress ln(y) indep vars without generate a …
Endogeneity correction via Gaussian Copulas - generating normal CDF of a non-normal empirical distribution functionDear Stata experts, I am a passionate passive follower in the forum, you guys helped me a lot in th…
Help generating this type of plotHey all, I need some assistance regarding the appropriate data shaping and plot type to generate thi…
Monte Carlo SimulationHi all, I want to be able to run a Monte Carlo simulation for an econometrics assignment that I hav…
Generate New Variable = Average Price Per Type Per YearI am using Stata version 15.1 and I have 47 variables and 1,010 observations in my dataset. I am doi…
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy based on variable value in subset year
Post a Comment