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?
Writing loop for multiple regressionsI have 10 dependant variables, y1-y30, and its respective lagged variables, lagy1-lagy30. I would li…
How to present vignettes in a tabular formatHello everyone, Could you please help me to present vignettes in a tabular format rather than a run…
using "spmap"Hi guys, I am trying to map the result by using "spmap" command, yet keep having troubles with the …
FMM lcprob variablesHello experts, In FMM (finite mixture models), our main models(s) could have certain IVs. Then, I c…
calculating and graphing marginal effects from logit with interaction effect of two categorical variables Code: * Example generated by -dataex-. To install: ssc install dataex clear input byte(owndecision…
Subscribe to:
Post Comments (Atom)
0 Response to command to calculate average growth rate with 5 years interval?
Post a Comment