Hi everyone.
I am fairly new to Stata and wondered if anyone of you more experienced users could give me a tip?
I am looking at the progression of academic careers by following a number of researchers from 1995 to 2015. Now a “start” year is chosen for each observation and I want to create a range of pre and post measures on their publication activities before and after this given year.
Say I want to make a pre measure for observations with the start year 2001:
gen newvar = (var1_95+var1_96 +var1_97+var1_98 var1_99 var00)/(var2_95+var2_96+var2_97+var2_98+var2_99) if start_year==2001
Now I have to do this with numerous different start years and several other variables, can I do this in an easier way for instance with loops? Can I somehow automatically generate these new variables based on the start year?
Hope you can help. Thanks in advance.
I am fairly new to Stata and wondered if anyone of you more experienced users could give me a tip?
I am looking at the progression of academic careers by following a number of researchers from 1995 to 2015. Now a “start” year is chosen for each observation and I want to create a range of pre and post measures on their publication activities before and after this given year.
Say I want to make a pre measure for observations with the start year 2001:
gen newvar = (var1_95+var1_96 +var1_97+var1_98 var1_99 var00)/(var2_95+var2_96+var2_97+var2_98+var2_99) if start_year==2001
Now I have to do this with numerous different start years and several other variables, can I do this in an easier way for instance with loops? Can I somehow automatically generate these new variables based on the start year?
Hope you can help. Thanks in advance.
Comment