I have a panel dataset and need to take the lag of the total population with a 5-year interval so that in the end I can get the average growth rate.
For that purpose, the command I used are:
rename Year_ Population_growth
gen lag1 = Population_growth[_n-1]
gen growth_rate = (Population_growth-lag1[_n-5]/lag1[_n-5])*100
My dataset looks something like this:
Country_name Year Country_code Population_growth _merge
Afghanistan 1950 4 7752.117 matched (3)
Algeria 1951 4 7840.151 matched (3)
Afghanistan 1952 4 8039.684 matched (3)
Angola 1954 4 8151.316 matched (3)
Afghanistan 1955 4 8270.992 matched (3)
Please let me know the commands that could be used to calculate population growth and then the average growth rate of the dataset?
Related Posts with command to calculate average growth rate with 5 years interval?
Droping outliers based on different criteriaDear all, I use Stata 13 and I want to calculate average value of X removing outliers (1st and 99th…
How to specify family-level option for psmatch2 (my data is at the child-level)Hi everyone, first post so pardon me if I'm making a rookie mistake. I want to compare the differen…
Synthetic Control Aggregating Data from firm levelMy question is focused on finding the effect of the Brexit vote on the profitability of UK banks. I …
Panel Data Estimator ConfusionHi Statalist, I'm currently attempting to look at the impact of different variables on democracy. I…
How to deal with a difference in difference fixed effects model with a discrete treatment variable?Hi, I am trying to conduct a fixed effects difference in difference model to estimate the effect of …
Subscribe to:
Post Comments (Atom)
0 Response to command to calculate average growth rate with 5 years interval?
Post a Comment