Dear all,
I have an urgent question. I am trying to compute average annual growth between a variable (lval_per_worker) in different years (endpoints). I want to compute the difference between annual average growth rate for years 2015 and 1980 for the variable lval_per_worker ( I only want the difference between the end points) over the difference in years (2015-1980=35). Later, I want to regress the average annual growth rate (variable I want to construct) over the log of value added per worker in 1980 (lval_per_worker in 1980). My data includes country, isic (industry) and years (unbalanced panel).
avg annual growth rate (lval_per_worker_2015- lval_per_worker_1980)= C+ \beta*lval_per_worker_1980 (OLS).
Initially I tried the following code but it includes more points than the years I want ( how can I only include lval_per_worker_2015 and lval_per_worker_1980 to calculate perc_wanted?). r_valworker is calculated by picking value added and dividing it by employment (deflating using the Producer Price Index) (r_val_worker)
Thank you so much!
Once I create variables to regress each variable, I find no observations because columns do not match if I do the following:
I have an urgent question. I am trying to compute average annual growth between a variable (lval_per_worker) in different years (endpoints). I want to compute the difference between annual average growth rate for years 2015 and 1980 for the variable lval_per_worker ( I only want the difference between the end points) over the difference in years (2015-1980=35). Later, I want to regress the average annual growth rate (variable I want to construct) over the log of value added per worker in 1980 (lval_per_worker in 1980). My data includes country, isic (industry) and years (unbalanced panel).
avg annual growth rate (lval_per_worker_2015- lval_per_worker_1980)= C+ \beta*lval_per_worker_1980 (OLS).
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int country1 str2 isic int year double ValueAdded long Employment float(r_valworker lval_worker ln_1980 perc_wanted2) 398 "18" 1994 . . . . 0 . 400 "22" 2011 139139437 5745 12046.368 9.396519 9.251294 .004684663 705 "21" 1985 . . . . 0 . 524 "21" 2008 658341 873 397.7566 5.98584 0 . 60 "22" 1999 . 390 . . 0 . 705 "21" 2006 173368275 5226 20136.074 9.910268 0 . 266 "19" 1970 . . . . 0 . 231 "21" 2001 6275383 1357 3446.155 8.145015 0 . 388 "18" 1991 . . . . 0 . 410 "19" 2014 1905086243 18218 50931.88 10.838244 0 . 438 "16" 2011 . 0 . . 0 . 178 "15" 1970 17279109 11099 4219.0156 8.347357 0 . 894 "21" 1988 . . . . 9.881193 . 422 "20" 2008 227872079 . . . 0 . 462 "20" 2006 . . . . 0 . 360 "21" 1987 127140683 26400 4684.382 8.451989 8.297654 .02204786 340 "15" 1993 204757476 31821 5411.45 8.596272 0 . 250 "21" 2010 5430930955 68254 43072.58 10.670642 10.40521 .008847745 764 "19" 2010 656890087 114280 3111.553 8.042877 0 . 50 "17" 1971 95185531 164400 1519.3197 7.326018 7.223282 . 616 "22" 1983 188967777 44000 4241.7007 8.352719 8.179547 .057724 214 "22" 1998 . . . . 9.139141 . 70 "16" 1994 . 440 . . 0 . 120 "15" 1993 200874000 20980 8052.041 8.993681 9.822526 -.06375731 508 "21" 2013 . . . . 0 . 800 "16" 1993 7676880 764 8450.436 9.041973 0 . 686 "17" 2014 3017008 2180 674.0557 6.513313 9.26582 -.08095608 280 "17" 1981 6750882719 296000 23264.57 10.054687 10.104993 -.05030632 530 "19" 1991 . . . . 0 . 268 "20" 1999 . 1797 . . 0 . 12 "16" 1984 . . . . 9.920269 . 360 "19" 1993 . . . . 0 . 192 "18" 1975 . . . . 8.889088 . 356 "16" 2014 2543031885 437107 2833.6084 7.949306 6.411442 .0452313 446 "15" 1999 14374894 1244 9209.31 9.12797 7.995726 .0595918 630 "22" 1974 . 3030 . . 0 . 376 "21" 1986 174966831 6000 29112.62 10.278927 10.303637 -.0041182837 360 "17" 2004 2951242045 546145 3684.1794 8.211803 7.618095 .024737835 894 "15" 1996 . . . . 9.671973 . 112 "15" 2002 . . . . 0 . 531 "19" 2014 . . . . 0 . 40 "15" 1974 759128322 62900 22565.56 10.02418 10.241074 . 590 "22" 2007 . 3392 . . 9.464402 . 705 "19" 2015 69899345 3612 10161.63 9.226374 0 . 484 "22" 1993 192442139 9438 17147.781 9.749624 0 . 196 "22" 1976 5975698 991 9863.634 9.1966095 9.373387 . 450 "21" 1981 4184294 1072 3981.5635 8.28943 8.62533 -.3359003 372 "17" 1963 49839242 21900 7207.489 8.882875 9.754238 . 288 "21" 1966 2000000 554 10838.454 9.290855 8.529375 . 704 "22" 2004 . 40218 . . 0 . 170 "22" 1975 71227784 17500 6967.462 8.849007 9.24948 . 32 "22" 1990 694786798 27848 21454.033 9.973668 0 . 702 "21" 2014 198668561 3638 26597.59 10.188576 9.356116 .0244841 266 "21" 1991 308394 . . . 9.535266 . 554 "15" 1999 2834970528 60702 37221.027 10.52463 9.834158 .036340613 706 "20" 1971 0 0 . . 0 . 428 "18" 2005 72261586 13291 3454.181 8.147341 0 . 604 "17" 1996 499464198 27567 14189.943 9.560288 0 . 590 "22" 1973 10510000 1737 13438.45 9.505876 9.464402 . 840 "18" 1963 8.870e+09 1459000 19254.178 9.865483 9.898 . 686 "22" 2014 8395717 1172 3489.04 8.157382 9.650778 -.04392341 388 "15" 1976 193050193 17341 18210.34 9.809745 9.204855 . 380 "15" 1997 17883048196 308313 45456.82 10.724518 10.678854 .002686108 710 "16" 1982 86570837 5000 17311.281 9.759113 10.333258 -.28707218 8 "18" 2019 148923869 28916 2577.152 7.85444 0 . 724 "16" 1984 464042898 11000 40690.35 10.613747 11.005033 -.09782147 688 "22" 1997 . . . . 0 . 752 "18" 1977 370399956 25200 22656.51 10.028202 10.031988 . 756 "21" 1993 986047129 15700 52818.46 10.874616 0 . 230 "16" 1970 4804000 432 30136.51 10.313493 10.653697 . 894 "19" 1974 . . . . 0 . 152 "16" 1974 170370395 1530 208201.7 12.246263 12.534375 . 356 "22" 1990 339817751 142527 2050.2195 7.625702 7.563256 .006244612 32 "20" 1977 . 56761 . . 0 . 862 "16" 1985 596666667 3700 156336.66 11.959767 11.537888 .08437596 716 "20" 2013 152589397 . . . 0 . 230 "17" 1971 33160850 21409 4064.5205 8.310051 8.299515 . 480 "17" 2006 64933003 6813 5784.978 8.66302 8.413436 .009599392 68 "19" 1987 . . . . 0 . 44 "15" 1996 61308600 876 54812.94 10.91168 0 . 340 "21" 1985 9307000 1431 6305.229 8.749135 0 . 40 "22" 2011 1434827341 13325 53558.5 10.88853 10.158862 .02353767 340 "15" 1965 22690000 5127 13715.672 9.526295 0 . 68 "16" 2016 . . . . 11.706547 . 807 "19" 2010 20494041 4417 2511.626 7.828686 0 . 140 "15" 1991 29811393 1239 20647.18 9.935334 9.1395 .072348595 32 "22" 2012 3292850855 . . . 0 . 462 "20" 2016 . . . . 0 . 158 "21" 2011 1646073386 49368 16584.393 9.716217 0 . 776 "20" 1993 . 43 . . 0 . 634 "16" 1999 . . . . 0 . 398 "19" 1994 . . . . 0 . 686 "20" 1990 558280 69 6957.519 8.847578 9.030405 -.0182827 203 "20" 2002 552784632 46025 9160.186 9.122622 0 . 278 "21" 1978 . 93900 . . 0 . 32 "15" 2005 8826431005 . . . 0 . 840 "20" 1976 1.011e+10 491000 33681.516 10.424705 10.247317 . 60 "22" 2009 . 289 . . 0 . 52 "15" 1978 18862000 1992 13538.247 9.513274 9.346107 . 60 "18" 2003 . 17 . . 0 . end
Code:
bysort country isic: g ln_1980=ln(r_valworker) if year==1980 replace ln_1980=0 if ln_1980==. gen check=0 if ln_1980!=0 sort country isic check drop check bysort country isic : replace ln_1980=sum( ln_1980) g lval_per_worker=ln(r_valworker) bysort country isic year: gen perc_wanted= (lval_per_worker-ln_1980)/abs(year-1980) if year>1980 &ln_1980!=0
Once I create variables to regress each variable, I find no observations because columns do not match if I do the following:
Code:
bysort country isic: g ln_1980=ln(r_valworker) if year==1980
Code:
bysort country isic: g ln_2015=ln(r_valworker) if year==205

Comment