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
How can I calculate mediation using bootstrapping?Hello I conducted SEM bootstrapping to find mediation effect in structural equation modeling. Howeve…
How to draw a graph for inverted U-shaped relationships like the graph presented below?Array My regression is: Y1=α1FD1+α2FD1^2+α3Controls, and the results showed this is a bell-shaped re…
System GMM: time dummies vs time trendsHi everyone, I am running a system GMM model with a N=31 T=10 dataset. I included a time trend (equ…
Linearity of mixed modelHi , does the fact that mixed command is made for linear models mean that I can not have logged inde…
Panel regression and plots in stataHi Statalist, can someone please suggest any resources for a beginner in panel regression (and plott…
Subscribe to:
Post Comments (Atom)
0 Response to Create laggings
Post a Comment