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?
Hosmer–Lemeshow test for large data setsHosmer–Lemeshow test for large data sets gives low p value despite perfectly fitting model. Increasi…
stata mp 15 computing speedhi, I recently upgraded to stata mp 15 in order to use the multi processor capabilities. however, wh…
firthlogit: initial vector: matrix must be dimension 10Dear Stataforum First, I want to thank all Stataforum contributors for your yeoman service. I have …
reshape commandhi, I need to reshape a huge data set wide to long (2557 binary variables and 1.6 million observatio…
Using Multiple Imputations in Propensity Score MatchingHello everyone, I want to see the impact of a treatment, hence, using the propensity score matching…
Subscribe to:
Post Comments (Atom)
0 Response to command to calculate average growth rate with 5 years interval?
Post a Comment