Hi,
I want to create a variable that shows the 5 year growth rate. My first thought is to write something like:
by CountryName: gen growth5 = (GDP- GDP[n_-5])/GDP_[n_-5]
But that won't work when there are missing years. For example if 1996 is missing, 5 years before 1997 will be computed as 1991(or more obviously, 1 year before 1997 will be marked as 1995 if 1996 is missing). What can I do instead?
Thank you!
Related Posts with using lagged values to find 5 year growth rate when there are missing years in the data
Quantile regression with pweights, cluster standard errors and strata fixed effectsHi! I need to run a cross-sectional quantile regression with pweights, strata fixed effects and clus…
How to Conduct the Pre and Post Analysis?Dear all, I have panel data from 2015 to 2019, i want to check pre period 2015 and 2016 descriptive …
Meta-analysis Ipdmetan (ssc) versus meta forestplotHi, I am doing meta-analysis for individual patient data. I get different overall results when I us…
How to Conduct the Pre and Post Analysis?Dear all, I have panel data from 2015 to 2019, i want to check pre period 2015 and 2016 descriptive …
Postfile only posts results of first iteration of the loopDear statalist, I have a big file that overwhelms my memory when I try to run my script. Therefore,…
Subscribe to:
Post Comments (Atom)
0 Response to using lagged values to find 5 year growth rate when there are missing years in the data
Post a Comment