Hi all,
I am working on a dataset consisting of quarterly company data with multiple companies over the period 2000-2020. In the dataset I have quarterly earnings, which I would like to convert in a 4 period rolling yearly earnings. For example in 19Q3 I would like the sum of 18Q4, 19Q1, 19Q2 and 19Q3. However, this needs to be per company, which implies that the code should stop summing the values of the first company when a new companyid is reached and should continue when 4 values of that company are available.
I have tried many things from rangestat to tsegen, but it did not work. Seems like an easy task but already spend 4 hours trying. Could anyone help me with this?
Thanks a lot!
Related Posts with Rolling yearly earnings
Moderated Mediation on archival longitudinal data (with no latent variables)Hi, I have organizational data for 5 years (archival panel with no latent variables). I am strugglin…
Help running a bootstrap within a forvalues loopDear all, Apologies if this is very basic, however I have spent the better part of a day going thro…
colour coding in two-way dropline plotHello, I am trying to distinguish droplines in a two-way dropline plot using different colour codes …
Legend for a Graph Hello, I made a graphic and now I want to add a legend. the points have the name of the job group,…
Error 909Dear Stalist Members, I need help with how to solve Error 909 where the operating system refuses to…
Subscribe to:
Post Comments (Atom)
0 Response to Rolling yearly earnings
Post a Comment