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
ONE QUESTION about GSEMDear stata users in GSEM , Is it logically correct to have such a model in general? Array …
Exporting results of Ttests with Unequal variancesI have a bunch of variables and I want to conduct a 2-group mean comparison test with unequal varian…
how to draw a bar like the picturehow to draw a bar like the picture using the following data,thanks! clear input int year double(Juni…
DiD for binary outcomesHow to run the difference in difference estimates for binary outcomes? …
Import all files from a folderA folder contains a lot of csv files with similar rows and columns. Without having to list all their…
Subscribe to:
Post Comments (Atom)
0 Response to Creating dummy based on variable value in subset year
Post a Comment