I use Stata for the empirical part of my bachelor thesis and have not used Stata before so I would be very grateful for your help!
I try to generate a new variable: the average ROA of the last three years. The problem is, that I have more than one observation for one year. What should I add to my command, that Stata uses only the ROA from the last three years with the same GVKEY (company code)?
command: generate average_roa = (ROA + ROA [YEAR -1] + ROA [YEAR -2])/3
data set:
Thank you in advance!
Laura
0 Response to Generate a variable
Post a Comment