I have a quarterly panel data and I want to generate a variable 'plants' that is the sum of plant(1)+...+plant(n) by year and not by quarter, in a way to have the same value for 'plants' in each quarter of the same year.
I tried the following code but it gives values by quarter.
Code:
gen plants= plant1+plant2+plant3+plant4+plant5+plant6+plant7+plant8+plant9+plant10+plant11+plant12+plant13
0 Response to Generate a variable by year
Post a Comment