Hi,
I want to run a regression in which the dependent variable is average growth rate of value added per worker and the independent variable is the log of value added per worker at an initial point (dataex is below). The data is an unbalanced panel across countries contemplating country, industry (isic), and year. Initially, I calculated the average annual growth rates for my years following Nick Cox's application of conditional and later I've calculated the average annual growth rate)
My question is how to do to these regressions by period (so I can include more countries rather than just some by doing the regressions with specific years). For instance,
Growth of rate of value added per worker (from 1975-1980)= Initial Value added per worker (1975-1980)
So far, what I've been doing is
(average annual growth)
------------------------------------------------------------------------------
How can I run these type of regressions on five year periods? (I tried creating a period=5*floor(year/5) and collapsed all variables by period but I am sure that's not the right approach given that variables don't smooth as necessary)
Thank you!
I want to run a regression in which the dependent variable is average growth rate of value added per worker and the independent variable is the log of value added per worker at an initial point (dataex is below). The data is an unbalanced panel across countries contemplating country, industry (isic), and year. Initially, I calculated the average annual growth rates for my years following Nick Cox's application of conditional and later I've calculated the average annual growth rate)
My question is how to do to these regressions by period (so I can include more countries rather than just some by doing the regressions with specific years). For instance,
Growth of rate of value added per worker (from 1975-1980)= Initial Value added per worker (1975-1980)
So far, what I've been doing is
Code:
bysort country isic: egen ln_1980= mean (cond(year==1980, ln(val_per_worker,.))
Code:
bysort country isic: egen ln_2019= mean (cond(year==2019, ln(val_per_worker,.))
Code:
gen av_ann_growth= (ln_2019-ln_1980)/abs(2019-1980)
Code:
reg av_ann_growth ln_1980 i.country i.isic1 i.year, robust
Linear regression Number of obs = 29,888
F(114, 29773) = 3670.92
Prob > F = 0.0000
R-squared = 0.5659
Root MSE = .01079
------------------------------------------------------------------------------
| Robust
av_ann_gro~h | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
ln_1980 | -.0145573 .000287 -50.72 0.000 -.0151198 -.0139948
|
country |
40 | .0053123 .0002472 21.49 0.000 .0048277 .0057969
56 | .0030002 .0003452 8.69 0.000 .0023235 .0036768
124 | .0058293 .0002624 22.21 0.000 .0053149 .0063437
144 | -.0194746 .0009778 -19.92 0.000 -.0213911 -.0175581
152 | -.0146902 .0005757 -25.52 0.000 -.0158186 -.0135619
170 | -.0149132 .0003762 -39.64 0.000 -.0156506 -.0141758
196 | -.0143605 .0004269 -33.64 0.000 -.0151973 -.0135238
208 | .004522 .0003898 11.60 0.000 .003758 .005286
218 | -.0158834 .0003904 -40.69 0.000 -.0166485 -.0151182
242 | -.0234721 .0005679 -41.33 0.000 -.0245852 -.0223591
246 | .001825 .0003055 5.97 0.000 .0012262 .0024239
250 | -.0023131 .0002553 -9.06 0.000 -.0028135 -.0018128
300 | -.0164003 .0003919 -41.84 0.000 -.0171686 -.0156321
344 | -.005519 .0011802 -4.68 0.000 -.0078323 -.0032058
348 | -.0126267 .0004931 -25.61 0.000 -.0135932 -.0116602
352 | -.0011192 .0005864 -1.91 0.056 -.0022686 .0000303
356 | -.0223825 .0007734 -28.94 0.000 -.0238985 -.0208665
360 | -.0057511 .0007827 -7.35 0.000 -.0072852 -.0042169
376 | -.0043756 .0003132 -13.97 0.000 -.0049895 -.0037617
380 | -.0041305 .0003348 -12.34 0.000 -.0047867 -.0034742
404 | -.0172134 .0010836 -15.89 0.000 -.0193373 -.0150895
410 | .0222026 .0003879 57.24 0.000 .0214423 .0229629
458 | -.0139197 .0006056 -22.98 0.000 -.0151067 -.0127327
470 | -.006881 .0003948 -17.43 0.000 -.0076549 -.0061072
480 | -.0164284 .0008748 -18.78 0.000 -.0181432 -.0147137
504 | -.0279229 .0013635 -20.48 0.000 -.0305954 -.0252505
528 | .0031918 .0003032 10.53 0.000 .0025975 .0037862
554 | -.0026723 .000329 -8.12 0.000 -.0033172 -.0020274
578 | .0060698 .0002469 24.59 0.000 .0055859 .0065537
608 | -.0210231 .0005736 -36.65 0.000 -.0221473 -.0198988
616 | -.0085458 .0005771 -14.81 0.000 -.009677 -.0074146
620 | -.0049764 .0004961 -10.03 0.000 -.0059489 -.004004
702 | .0004065 .0007152 0.57 0.570 -.0009953 .0018083
710 | -.0237854 .0005235 -45.44 0.000 -.0248114 -.0227593
724 | -.0043472 .0002226 -19.53 0.000 -.0047836 -.0039109
752 | .0014386 .000297 4.84 0.000 .0008565 .0020207
788 | -.0255585 .0008276 -30.88 0.000 -.0271806 -.0239364
792 | -.021671 .0004094 -52.93 0.000 -.0224735 -.0208685
826 | -.0017844 .0003208 -5.56 0.000 -.0024132 -.0011557
840 | .0179586 .000364 49.33 0.000 .0172451 .0186721
|
isic1 |
16 | .025331 .0007565 33.49 0.000 .0238483 .0268138
17 | -.0061132 .0002264 -27.00 0.000 -.0065569 -.0056695
18 | -.0116301 .0003828 -30.38 0.000 -.0123804 -.0108797
20 | -.0029236 .0003337 -8.76 0.000 -.0035776 -.0022696
21 | .0013253 .0002468 5.37 0.000 .0008415 .001809
22 | -.0046862 .0002594 -18.07 0.000 -.0051946 -.0041778
23 | .0315788 .0006417 49.21 0.000 .0303211 .0328365
24 | .0109738 .0003127 35.09 0.000 .0103608 .0115867
25 | -.0023501 .000214 -10.98 0.000 -.0027696 -.0019307
26 | .003186 .0002074 15.36 0.000 .0027795 .0035926
27 | .0055117 .0002954 18.66 0.000 .0049328 .0060906
28 | -.0032884 .000185 -17.77 0.000 -.0036511 -.0029257
29 | .0001126 .0002969 0.38 0.705 -.0004693 .0006944
31 | .00112 .000283 3.96 0.000 .0005653 .0016746
33 | -.0086865 .0004764 -18.23 0.000 -.0096203 -.0077527
34 | .0040468 .0003594 11.26 0.000 .0033424 .0047513
36 | -.0045853 .0002575 -17.81 0.000 -.0050899 -.0040806
|
year |
1964 | .0000732 .0007287 0.10 0.920 -.0013551 .0015014
1965 | -.0000264 .000729 -0.04 0.971 -.0014552 .0014025
1966 | .0000873 .0007208 0.12 0.904 -.0013255 .0015
1967 | -6.45e-06 .0007294 -0.01 0.993 -.0014361 .0014232
1968 | .000017 .0007066 0.02 0.981 -.0013679 .001402
1969 | -.0000718 .0007184 -0.10 0.920 -.0014799 .0013363
1970 | -.0000416 .0007044 -0.06 0.953 -.0014223 .0013391
1971 | -.0001076 .0007116 -0.15 0.880 -.0015023 .0012871
1972 | -.0000416 .0007044 -0.06 0.953 -.0014223 .0013391
1973 | -.000079 .0007101 -0.11 0.911 -.0014708 .0013127
1974 | -.000079 .0007101 -0.11 0.911 -.0014708 .0013127
1975 | -.000079 .0007101 -0.11 0.911 -.0014708 .0013127
1976 | -.0000136 .0007276 -0.02 0.985 -.0014398 .0014125
1977 | -.0000136 .0007276 -0.02 0.985 -.0014398 .0014125
1978 | .0000252 .0007274 0.03 0.972 -.0014005 .0014508
1979 | .0000252 .0007274 0.03 0.972 -.0014005 .0014508
1980 | .0000252 .0007274 0.03 0.972 -.0014005 .0014508
1981 | .0000627 .000713 0.09 0.930 -.0013348 .0014602
1982 | .0001107 .0007083 0.16 0.876 -.0012776 .0014989
1983 | .0001543 .0007068 0.22 0.827 -.001231 .0015397
1984 | .0001543 .0007068 0.22 0.827 -.001231 .0015397
1985 | -.0000907 .0006901 -0.13 0.895 -.0014433 .001262
1986 | -.0000948 .0006895 -0.14 0.891 -.0014463 .0012567
1987 | -.0000948 .0006895 -0.14 0.891 -.0014463 .0012567
1988 | -.0001156 .0006878 -0.17 0.867 -.0014637 .0012326
1989 | -.0001189 .0006949 -0.17 0.864 -.0014809 .0012431
1990 | -.0000208 .000678 -0.03 0.975 -.0013497 .001308
1991 | -.0000585 .0006832 -0.09 0.932 -.0013977 .0012807
1992 | -.0000316 .0006836 -0.05 0.963 -.0013715 .0013083
1993 | .0000876 .0006821 0.13 0.898 -.0012494 .0014246
1994 | .0000723 .0006825 0.11 0.916 -.0012654 .00141
1995 | -9.96e-06 .0006828 -0.01 0.988 -.0013483 .0013284
1996 | -.0000905 .0006862 -0.13 0.895 -.0014355 .0012545
1997 | -.000104 .000687 -0.15 0.880 -.0014505 .0012425
1998 | -.0000916 .0006882 -0.13 0.894 -.0014406 .0012573
1999 | -.0001222 .0006815 -0.18 0.858 -.0014578 .0012135
2000 | -3.76e-06 .0006777 -0.01 0.996 -.0013321 .0013246
2001 | -3.76e-06 .0006777 -0.01 0.996 -.0013321 .0013246
2002 | -.0000629 .0006784 -0.09 0.926 -.0013926 .0012668
2003 | -.0001132 .0006769 -0.17 0.867 -.0014398 .0012135
2004 | -.0001642 .0006751 -0.24 0.808 -.0014874 .001159
2005 | -.0002042 .000674 -0.30 0.762 -.0015253 .0011169
2006 | -.0001419 .0006855 -0.21 0.836 -.0014856 .0012018
2007 | -.0001185 .0006844 -0.17 0.863 -.0014599 .001223
2008 | -9.76e-06 .0006807 -0.01 0.989 -.001344 .0013245
2009 | 1.13e-06 .0006806 0.00 0.999 -.0013328 .0013351
2010 | .0000321 .0006786 0.05 0.962 -.0012979 .0013621
2011 | .0000275 .0006781 0.04 0.968 -.0013016 .0013566
2012 | .0000257 .0006785 0.04 0.970 -.0013042 .0013557
2013 | -.0000848 .0006801 -0.12 0.901 -.0014179 .0012483
2014 | -.0000848 .0006801 -0.12 0.901 -.0014179 .0012483
2015 | -.0000989 .0006794 -0.15 0.884 -.0014305 .0012327
2016 | -.0000846 .0006797 -0.12 0.901 -.0014168 .0012476
2017 | -.0000989 .0006794 -0.15 0.884 -.0014305 .0012327
2018 | -.0001544 .00068 -0.23 0.820 -.0014872 .0011784
2019 | -.0002536 .0006767 -0.37 0.708 -.0015799 .0010727
|
_cons | .1788519 .0029782 60.05 0.000 .1730145 .1846893
How can I run these type of regressions on five year periods? (I tried creating a period=5*floor(year/5) and collapsed all variables by period but I am sure that's not the right approach given that variables don't smooth as necessary)
Code:
* Example generated by -dataex-. To install: ssc install dataex. (dataex for year==1980) clear input int country long isic1 int year float(ln_1980 ln_2019 val_per_worker) 4 1 1980 . . . 4 2 1980 . . . 4 3 1980 . . . 4 7 1980 . . . 4 8 1980 . . . 4 9 1980 . . . 4 10 1980 . . . 4 11 1980 . . . 4 12 1980 . . . 4 13 1980 . . . 4 14 1980 . . . 4 19 1980 . . . 12 1 1980 9.580441 . 14478.798 12 2 1980 9.812777 . 18265.635 12 3 1980 9.303091 . 10971.88 12 6 1980 9.24304 . 10332.405 12 7 1980 9.258244 . 10490.695 12 8 1980 9.153545 . 9447.88 12 9 1980 9.917997 . 20292.32 12 10 1980 9.518955 . 13615.38 12 11 1980 9.709127 . 16467.232 12 12 1980 9.581053 . 14487.66 12 13 1980 9.226204 . 10159.896 12 14 1980 9.170505 . 9609.476 12 19 1980 9.250774 . 10412.628 12 22 1980 9.29205 . 10851.406 32 1 1980 . . . 32 2 1980 . . . 32 3 1980 . . . 32 6 1980 . . . 32 7 1980 . . . 32 8 1980 . . . 32 9 1980 . . . 32 10 1980 . . . 32 11 1980 . . . 32 12 1980 . . . 32 13 1980 . . . 32 14 1980 . . . 32 19 1980 . . . 32 22 1980 . . . 36 1 1980 10.19185 11.27491 26684.79 36 2 1980 10.812643 . 49644.52 36 3 1980 9.952108 11.057722 20996.443 36 6 1980 10.01615 11.200987 22385.094 36 7 1980 10.261066 11.73419 28597.273 36 8 1980 10.108777 11.145988 24557.604 36 9 1980 10.9824 12.420651 58829.51 36 10 1980 10.593992 11.827066 39894.42 36 11 1980 10.12378 11.394923 24928.855 36 12 1980 10.39719 11.676742 32767.406 36 13 1980 10.493634 12.208467 36085.063 36 14 1980 10.045395 11.150683 23049.39 36 19 1980 10.276264 . 29035.21 36 22 1980 9.887255 10.997367 19677.96 40 1 1980 10.13358 11.35429 25174.35 40 2 1980 13.0132 . 448291.7 40 3 1980 9.703811 11.272364 16379.904 40 6 1980 10.0043 11.47619 22121.377 40 7 1980 10.242295 11.9454 28065.477 40 8 1980 10.05137 11.366877 23187.52 40 9 1980 10.233692 12.53686 27825.047 40 10 1980 10.256224 12.002503 28459.11 40 11 1980 9.957572 11.39565 21111.477 40 12 1980 10.236194 11.52606 27894.76 40 13 1980 9.995841 11.841247 21935.05 40 14 1980 9.927979 11.441514 20495.885 40 19 1980 9.544119 . 13962.332 40 22 1980 9.876512 11.21545 19467.693 50 1 1980 7.696788 . 2201.2664 50 2 1980 9.770756 . 17514.006 50 3 1980 7.11579 . 1231.2556 50 6 1980 7.450129 . 1720.0842 50 7 1980 7.857102 . 2584.022 50 8 1980 7.191204 . 1327.7004 50 9 1980 8.849745 . 6972.608 50 10 1980 8.372579 . 4326.7773 50 11 1980 7.205095 . 1346.272 50 12 1980 8.07377 . 3209.1775 50 13 1980 8.379707 . 4357.7314 50 14 1980 6.955295 . 1048.6879 50 19 1980 6.464489 . 641.9365 50 22 1980 7.856623 . 2582.784 52 1 1980 9.238615 . 10286.777 52 2 1980 9.31109 . 11060 52 3 1980 8.346621 . 4215.909 52 6 1980 . . . 52 7 1980 9.006888 . 8159.091 52 8 1980 9.0155525 . 8230.089 52 9 1980 . . . 52 12 1980 8.921475 . 7491.131 52 13 1980 . . . 52 14 1980 8.949831 . 7706.587 52 19 1980 . . . 52 22 1980 8.678367 . 5874.443 56 1 1980 10.797876 11.627295 48916.82 56 2 1980 10.286183 11.64817 29324.65 56 3 1980 9.986129 11.22177 21723.05 56 6 1980 9.690048 11.650793 16156.028 56 7 1980 10.365226 11.622216 31736.594 56 8 1980 10.215666 11.46358 27327.975 end label values isic1 isic1 label def isic1 1 "15", modify label def isic1 2 "16", modify label def isic1 3 "17", modify label def isic1 6 "20", modify label def isic1 7 "21", modify label def isic1 8 "22", modify label def isic1 9 "23", modify label def isic1 10 "24", modify label def isic1 11 "25", modify label def isic1 12 "26", modify label def isic1 13 "27", modify label def isic1 14 "28", modify label def isic1 19 "33", modify label def isic1 22 "36", modify
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input int country long isic1 int year float(ln_1980 ln_2019 val_per_worker). (dataex for 2019) 4 1 2019 . . . 4 2 2019 . . . 4 3 2019 . . . 4 4 2019 . . . 4 5 2019 . . . 4 6 2019 . . . 4 7 2019 . . . 4 8 2019 . . . 4 9 2019 . . . 4 10 2019 . . . 4 11 2019 . . . 4 12 2019 . . . 4 13 2019 . . . 4 14 2019 . . . 4 15 2019 . . . 4 17 2019 . . . 4 21 2019 . . . 4 22 2019 . . . 8 1 2019 . 9.021728 . 8 2 2019 . . . 8 3 2019 . 8.702798 . 8 4 2019 . 8.546796 . 8 5 2019 . 8.603961 . 8 6 2019 . 9.185748 . 8 7 2019 . 8.799856 . 8 8 2019 . 9.77126 . 8 9 2019 . 10.12641 . 8 10 2019 . 9.728291 . 8 11 2019 . 9.065746 . 8 12 2019 . 9.733746 . 8 13 2019 . 11.00635 . 8 14 2019 . 9.366294 . 8 15 2019 . 9.453305 . 8 16 2019 . 8.756976 . 8 17 2019 . . . 8 18 2019 . . . 8 19 2019 . . . 8 20 2019 . . . 8 21 2019 . . . 8 22 2019 . 8.784404 . 12 1 2019 9.580441 . . 12 2 2019 9.812777 . . 12 3 2019 9.303091 . . 12 4 2019 9.029025 . . 12 5 2019 . . . 12 6 2019 9.24304 . . 12 7 2019 9.258244 . . 12 8 2019 9.153545 . . 12 9 2019 9.917997 . . 12 10 2019 9.518955 . . 12 11 2019 9.709127 . . 12 12 2019 9.581053 . . 12 13 2019 9.226204 . . 12 14 2019 9.170505 . . 12 15 2019 9.198872 . . 12 16 2019 . . . 12 17 2019 9.332821 . . 12 18 2019 . . . 12 19 2019 9.250774 . . 12 20 2019 9.249175 . . 12 21 2019 . . . 12 22 2019 9.29205 . . 24 1 2019 . . . 24 2 2019 . . . 24 3 2019 . . . 24 4 2019 . . . 24 5 2019 . . . 24 6 2019 . . . 24 9 2019 . . . 24 10 2019 . . . 24 11 2019 . . . 24 12 2019 . . . 24 13 2019 . . . 24 14 2019 . . . 24 15 2019 . . . 24 16 2019 . . . 24 17 2019 . . . 24 18 2019 . . . 24 19 2019 . . . 24 20 2019 . . . 24 21 2019 . . . 24 22 2019 . . . 31 1 2019 . 9.747452 . 31 2 2019 . 9.728014 . 31 3 2019 . 9.179392 . 31 4 2019 . 8.43468 . 31 5 2019 . 8.435524 . 31 6 2019 . 9.234807 . 31 7 2019 . 8.900663 . 31 8 2019 . 9.747595 . 31 9 2019 . 12.20364 . 31 10 2019 . 9.638375 . 31 11 2019 . 8.9854965 . 31 12 2019 . 9.674052 . 31 13 2019 . 10.30322 . 31 14 2019 . 9.728508 . 31 15 2019 . 9.339003 . 31 16 2019 . 9.584867 . 31 17 2019 . 8.782279 . 31 18 2019 . . . end label values isic1 isic1 label def isic1 1 "15", modify label def isic1 2 "16", modify label def isic1 3 "17", modify label def isic1 4 "18", modify label def isic1 5 "19", modify label def isic1 6 "20", modify label def isic1 7 "21", modify label def isic1 8 "22", modify label def isic1 9 "23", modify label def isic1 10 "24", modify label def isic1 11 "25", modify label def isic1 12 "26", modify label def isic1 13 "27", modify label def isic1 14 "28", modify label def isic1 15 "29", modify label def isic1 16 "30", modify label def isic1 17 "31", modify label def isic1 18 "32", modify label def isic1 19 "33", modify label def isic1 20 "34", modify label def isic1 21 "35", modify label def isic1 22 "36", modify
