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
Stacked chartsHi, I am trying to represent my data in a stacked chart. I have data on export and import. What I am…
McDonald's omega for measurement modelWith a view to SEM, I want to evaluate a measurement model with six items (expressing behaviour freq…
set n(#) in a kdensity loop with different sample sizesHi Statalist, I am new here but this forum is been helpful several times. I am using stata15, and t…
How to prevent incorrect (Windows) file time attribute of graphic files produced with graph exportsaving a graph using graph export for the first time under a name such as graphtime.wmf saves the gr…
Marginal probability change induced by a one-standard deviation change in the independent variables (probit)Hello everyone, I would like to run a probit regression in which target indicates whether a firm is…
Subscribe to:
Post Comments (Atom)
0 Response to Rolling yearly earnings
Post a Comment