Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating compound annual growth rate using the 10 most recent years

    Dear all,

    I am working with a country-year unbalanced panel dataset where I have data for 42 countries for 66 years (1950-2011). Most countries don't have missing data, only a few. I would like to calculate for each country, that has atleast 10 consecutive years of observations, the 10-year compound annual growth rate in labour productivity (lpAGR).

    Afterwards, I would like to use for each country only the most recent compound annual growth rate that I have estimated (so for the 10 most recent years) as an observation for a partial residual plot and regression analysis I want to conduct. In other words, each country enters the regression only once, namely with its most recent compound annual growth rate for labour productivity. If anybody has an idea as to how I can do this, I would be very grateful. An example of my dataset below:

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float countryid str8 Country int year float lpAGR
    1 "ARG" 1950 3.1000805
    1 "ARG" 1951  3.237293
    1 "ARG" 1952  3.037698
    1 "ARG" 1953 3.3209686
    1 "ARG" 1954 3.4466496
    1 "ARG" 1955  3.669939
    1 "ARG" 1956   3.70715
    1 "ARG" 1957 3.9136565
    1 "ARG" 1958  4.079468
    1 "ARG" 1959  3.916402
    1 "ARG" 1960 4.1331997
    1 "ARG" 1961 4.3635325
    1 "ARG" 1962  4.281728
    1 "ARG" 1963  4.133346
    1 "ARG" 1964 4.4286723
    1 "ARG" 1965  4.739155
    1 "ARG" 1966  4.729681
    1 "ARG" 1967  4.838055
    1 "ARG" 1968  5.026396
    1 "ARG" 1969   5.39341
    1 "ARG" 1970  5.723258
    1 "ARG" 1971  5.519807
    1 "ARG" 1972  5.296775
    1 "ARG" 1973  5.962359
    1 "ARG" 1974  6.213488
    1 "ARG" 1975  5.845764
    1 "ARG" 1976  6.533886
    1 "ARG" 1977  6.995625
    1 "ARG" 1978  7.239421
    1 "ARG" 1979  7.666711
    1 "ARG" 1980  7.349903
    1 "ARG" 1981  7.653934
    1 "ARG" 1982  8.198707
    1 "ARG" 1983  8.151571
    1 "ARG" 1984  8.118316
    1 "ARG" 1985  7.870948
    1 "ARG" 1986  7.609538
    1 "ARG" 1987   7.51709
    1 "ARG" 1988  8.020491
    1 "ARG" 1989  7.298735
    1 "ARG" 1990  7.836623
    1 "ARG" 1991  8.122811
    1 "ARG" 1992  8.268765
    1 "ARG" 1993  8.542512
    1 "ARG" 1994  9.245633
    1 "ARG" 1995 10.138309
    1 "ARG" 1996 10.183103
    1 "ARG" 1997 10.263948
    1 "ARG" 1998 11.257387
    1 "ARG" 1999 11.730783
    1 "ARG" 2000 11.813055
    1 "ARG" 2001 12.263212
    1 "ARG" 2002 11.987186
    1 "ARG" 2003  13.40027
    1 "ARG" 2004 12.971842
    1 "ARG" 2005 14.091387
    1 "ARG" 2006 14.432452
    1 "ARG" 2007 15.686748
    1 "ARG" 2008 15.084748
    1 "ARG" 2009 12.829973
    1 "ARG" 2010 16.210688
    1 "ARG" 2011 15.943043
    2 "BOL" 1950  .3461381
    2 "BOL" 1951  .3626744
    2 "BOL" 1952  .3677343
    2 "BOL" 1953   .328675
    2 "BOL" 1954  .3317593
    2 "BOL" 1955  .3527552
    2 "BOL" 1956  .3381603
    2 "BOL" 1957  .3392417
    2 "BOL" 1958 .37629995
    2 "BOL" 1959  .3813979
    2 "BOL" 1960 .39668375
    2 "BOL" 1961  .4045781
    2 "BOL" 1962  .4086128
    2 "BOL" 1963  .4257282
    2 "BOL" 1964  .4283201
    2 "BOL" 1965  .4427973
    2 "BOL" 1966  .4540542
    2 "BOL" 1967  .4501679
    2 "BOL" 1968  .4777359
    2 "BOL" 1969  .4549239
    2 "BOL" 1970  .4686968
    2 "BOL" 1971   .486809
    2 "BOL" 1972  .4997721
    2 "BOL" 1973  .5297314
    2 "BOL" 1974  .5580683
    2 "BOL" 1975  .6128862
    2 "BOL" 1976  .6558188
    2 "BOL" 1977  .6620467
    2 "BOL" 1978  .6807614
    2 "BOL" 1979  .7012367
    2 "BOL" 1980  .7047803
    2 "BOL" 1981  .6796002
    2 "BOL" 1982  .7206315
    2 "BOL" 1983  .5881137
    2 "BOL" 1984  .6995865
    2 "BOL" 1985  .7358668
    2 "BOL" 1986  .6968194
    2 "BOL" 1987  .6994631
    end

    Best,

    Ryan Marapin
    Last edited by Ryan Marapin; 28 Sep 2019, 05:58.

  • #2
    I don't really understand what you are asking for. You can, for each observation other than the first ten years of each country, calculate the annualized rate of growth of lpAGR over the past 10 years (which I take to mean from 9 years earlier through the current year) as follows:
    Code:
    encode Country, gen(country)
    xtset country year
    
    gen ten_yr_growth_rate = (lpAGR/L9.lpAGR)^(1/10)
    label var ten_yr_growth_rate "Annualized growth rate over past 10 years"
    Perhaps that will help you get started. I'm not sure this is what you are asking for, but it sounds like it might be related to it. I don't have any grasp of what you want to do with it after that. Maybe you want to use only the last value of that result for each country in some kind of regression, but it isn't clear to me what that means.

    Comment


    • #3
      Hi Clyde,

      Thank you for your answer. Sorry if my post was not clear. What I want to achieve is the following. I have an unbalanced panel dataset containing data for multiple countries for the period 1960-2011. I want to do a regression using as dependent variable the 10 year compound annual growth rate of labour productivity (decadal growth) for the most recent data containing atleast 10 observations for labour productivity. The explanatory variable is the initial value for productivity of that decade. I am interested in estimating a convergence parameter for each country.

      Best,

      Ryan

      Comment


      • #4
        OK, so the code in #2 gets you the 10 year compound annualized growth rate, for all years but the first ten. What you want to do now is ignore all but the last, and pair that up with the base value of productivity in that period. So follow that code with:

        Code:
        gen base_productivity = L9.lpAGR
        drop if missing(ten_yr_growth_rate)
        by country (year), sort: keep if _n == _N
        regress ten_yr_growth_rate base_productivity
        I am interested in estimating a convergence parameter for each country.
        What is a convergence parameter?

        Comment


        • #5
          Dear Clyde, thank you for your response. The code works nicely. I am interested in finding out whether there is a negative relationship between initial labour productivity and growth in labour productivity. A negative relationship would suggest that countries with lower initial labour productivity experience higher labour productivity growth, indicating in rough terms that there would be convergence in labour productivity of countries with different income levels. When running the regression, the coefficient for the initial labour productivity I therefore call the convergence parameter.


          Best,

          Ryan
          Last edited by Ryan Marapin; 29 Sep 2019, 15:11.

          Comment


          • #6
            Thanks for that explanation.

            Comment


            • #7
              Dear Clyde,

              I have a follow-up question if that is alright. Is it possible that I implement a different code where I do not keep only one observation per country but instead keep all the observations, and for the dependent variable of the regression I use the most recent 10-year compound annual growth rate? Because I want to control for fixed effects but if I do this Stata tells me that the explanatory variable "initial labour productivity" is dropped due to multicollinearity. This makes sense I guess, because using the above mentioned code I have only 1 observation per country. But now I am confused because I would like to run the regression described above while controlling for country fixed effects but I do not know if this possible then.

              Best,

              Ryan

              Comment

              Working...
              X