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
Order studies within group by time in meta-analysis forest plotHi everyone I am working on a forest plot. I want to order the studies within each group by publica…
To append or to mergeI would like to create a long panel from the 17 waves of panel data from the HILDA survey but am str…
Rename a function?How should I rename a function in Stata? I combine Stata and R, and to reduce confusion, I’d like t…
Is % bias is more important than t test results for PSM?My variable of interest is ethnicity. Ethnicity has two categories: natives or migrants. I want to s…
Import excel table to stataHi every one, I have problem when import data from excel. My excel table has type of: year 1 ye…
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