I am working with a country-year unbalanced panel dataset where I have data for 42 countries for 66 years (1950-2011). 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 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 greatful. 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
0 Response to Calculating compound annual growth rate using the 10 most recent years
Post a Comment