Hello,
I have a dataset of 1,791 firm-year observations. Now, I would like - for each firm-year observation - to incorporate the earnings number of the previous 5 years.
So, for example, I have this:
Company | fyear | earnings (on t=fyear)
x | 2018 | ...
x | 2017 | ...
y | 2018 | ...
y | 2017 | ...
y | 2016 | ...
y | 2015 | ...
z | 2016 | ...
z | 2015 | ...
z | 2014 | ...
What I want to get is this:
Company | fyear | earnings (on t=fyear) | earnings t=-1 | earnings t=-2 | earnings t=-3 | earnings t=-4 | earnings t=-5
__________________________________________________ __________________________________________
My questions is thus:
How can I merge COMPUSTAT's earnings output with my firm-year observations?
If you need more information, please feel free to ask!
Kind regards,
Pepijn
Related Posts with Create laggings
Panel data regression with high coefficients valuesDear All I have estimated a panel regression with command ' xtreg, fe cluster(id)'. (22 panels and …
STATA commands for PSTR modelHi Team Can STATA 14 run PSTR model? If it does can someone assist with the commands please. …
New versions of cprdonsutil and cprdhesutil on SSCThanks as always to Kit Baum, new versions of the cprdonsutil and cprdhesutil packages are now avail…
New packages cprdhesaeutil and cprdhesoputil on SSCThanks once again to Kit Baum, two new packages cprdhesaeutil and cprdhesoputil are now available fo…
Difference-in-difference with multiple treatments and multiple time periodsDear Statalisters, I have job level data and I am trying to estimate the impact of US state labor r…
Subscribe to:
Post Comments (Atom)
0 Response to Create laggings
Post a Comment