Announcement

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

  • Help panel data

    Hi i have a question. I need to estimate an equation that has GDP per capita on the left side and different types of educations on the right side. That means that i want to estimate an equation like the follow : GDP pr.capita = BHumanities + BSocialscience + BNaturalscience. My question is how i can do this in stata with panel data? I get some very strange results and i think its because i have some omitted variables, so what can I do about this when i only have data for the 4 variables.

    Thanks.

    Lars Larsen

  • #2
    Lars:
    welcome to the list.
    Please note that, as per FAQ, your chances of getting helpfu replies are conditional on posting what you typed and what Stata gave you back. Thanks.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      I agree with Carlo that your question is insufficiently unclear. It would have been better to post the command you gave and then shown the output that Stata gave you in response. We are now left to imagine specifically what you asked Stata to do and what "very strange results" means.

      In posting code and output, please do so between code delimiters to maximize readability. If you are not familiar with code delimiters, do read FAQ #12 for information.

      Comment


      • #4
        Data example:

        country year lh lh1 lh2 lh3 lh4 lh5 lh6 lsc gdpprcapita Lngdpprcapita) cnt
        "Australia" 1970 .23 .0398782 .0231493 .075746 .0619731 .0251263 .0048859 .38 3297.783658890969 3.518222161668829 1
        "Australia" 1975 .24 .0434189 .0171536 .079578 .0496291 .0408095 .0052198 .46 6987.820994580034 3.844341771230491 1
        "Australia" 1980 .26 .0510957 .0181297 .0862615 .0527791 .0435226 .0056467 .52 10186.128239877387 4.008009139493853 1
        "Australia" 1985 .27 .0536437 .01905 .0915275 .0561167 .0467734 .0059716 .52 11434.35444452409 4.058211650438609 1
        "Australia" 1990 .29 .0537562 .0205516 .0994003 .0615065 .0491281 .0065175 .53 18221.691211047597 4.260588682710515 1
        "Australia" 1995 .3 .052415 .0218571 .1062934 .0653021 .0495687 .006899 .54 20360.182212771855 4.3087816603860984 1
        "Australia" 2000 .26 .0424708 .0193854 .0934996 .0573972 .0414717 .0061612 .6 21665.115453957285 4.33576100774302 1
        "Australia" 2005 .31 .0483617 .0243137 .1146578 .0711797 .0485221 .0079303 .57 33982.95042715906 4.5312610819670684 1
        "Australia" 2010 .34 .0487059 .0267526 .1242806 .0771484 .0503105 .0086102 .4 51845.654860556235 4.714712364405712 1
        "Austria" 1970 .03 .0053349 .0040915 .0043568 .0092393 .0035775 .0038319 .25 2053.809513884762 3.312560161313362 2
        "Austria" 1975 .03 .0068255 .0042155 .0052293 .0094084 .003781 .0045222 .3 5272.887682335373 3.7220485205327756 2
        "Austria" 1980 .03 .0072167 .0033127 .0043836 .0093387 .0037938 .0039015 .36 10843.361723033193 4.03516394561788 2
        "Austria" 1985 .05 .0110062 .0054327 .0078134 .0152538 .0060838 .0063435 .39 9150.001210501036 3.9614211515215176 2
        "Austria" 1990 .06 .0126618 .0057542 .0090891 .0187649 .0070343 .0078402 .42 21628.76023101297 4.3350316262231425 2
        "Austria" 1995 .11 .0215547 .0100109 .0180707 .0313919 .0121858 .0126303 .44 30252.794692404106 4.480765500093529 2
        "Austria" 2000 .14 .027444 .0134734 .0268773 .0415015 .0161398 .0158752 .46 24517.26744601465 4.389472064571985 2
        "Austria" 2005 .17 .0312977 .0166642 .032428 .0473674 .0195237 .0179163 .5 38242.04251746993 4.582541080005137 2
        "Austria" 2010 .18 .0324376 .0163644 .0367897 .0539197 .0223363 .0176407 .51 46659.840818134384 4.668943252847709 2
        "Belgium" 1970 .08 .0252632 .0083635 .0147768 .0145187 .0125257 .0045104 .11 2780.6961867832715 3.444153541323246 3
        "Belgium" 1975 .11 .0330854 .0123723 .0235431 .0219255 .0191995 .0061423 .15 6737.248250693243 3.828482550309461 3
        "Belgium" 1980 .15 .0404446 .0161009 .0308031 .0290786 .027319 .0077186 .19 12932.860596457727 4.111694596330571 3
        "Belgium" 1985 .19 .0465938 .0197955 .0387995 .0374162 .0337386 .0090618 .22 8797.659678861352 3.94436715808967 3
        "Belgium" 1990 .23 .0504298 .0230519 .053829 .0482154 .039614 .0111262 .26 20710.644343080563 4.316193610737549 3
        "Belgium" 1995 .27 .0558961 .0256147 .0645294 .0608358 .0467479 .0125171 .33 28565.919151606613 4.455848202702486 3
        "Belgium" 2000 .29 .0554055 .0270939 .0710661 .0669346 .051626 .0131177 .33 23207.40591100777 4.365626598383652 3
        "Belgium" 2005 .31 .0548763 .0288158 .0820141 .073118 .0549444 .0132217 .38 36967.25918396876 4.567817252428573 3
        "Belgium" 2010 .34 .0536686 .0315124 .0918183 .0791965 .0608926 .0205466 .38 44382.818986702776 4.647214883103038 3
        "Canada" 1970 .21 .0491744 .0321545 .0595932 .0417956 .0271053 .0031366 .19 4121.932809248893 3.6151009081588 4
        "Canada" 1975 .26 .0586665 .0394309 .0783004 .051579 .0329064 .0036957 .2 7489.940531158274 3.8744783694895415 4
        "Canada" 1980 .3 .0605457 .0440631 .0946023 .0599292 .0365718 .0041186 .22 11135.437985484077 4.046707303627625 4
        "Canada" 1985 .22 .0408259 .0317077 .071962 .0443783 .0262073 .0029576 .28 14060.461778226454 4.147999584157656 4
        "Canada" 1990 .25 .0435743 .0353952 .0832968 .0504639 .0291637 .0032878 .3 21371.291098142116 4.329830759873997 4
        "Canada" 1995 .28 .0475413 .0394741 .0991347 .0587398 .0317653 .0034872 .33 20577.489385889534 4.3133923863463846 4
        "Canada" 2000 .31 .0478244 .0427658 .1090846 .0699396 .0346338 .0041969 .34 24124.169174630977 4.382452365369762 4
        "Canada" 2005 .47 .067494 .0598658 .1698405 .1132491 .0514271 .0097409 .35 36189.588384026494 4.558583643523713 4
        "Canada" 2010 .51 .0708525 .062835 .1836691 .1200198 .0596423 .0107932 .35 47445.76193478459 4.6761974253926395 4
        "Denmark" 1970 .12 .0201168 .0155488 .0112744 .030343 .0314868 .0137695 .18 3421.9899121286226 3.5342787249264926 5
        "Denmark" 1975 .14 .0250464 .0153354 .0131988 .0341405 .0415895 .0148468 .23 7954.974162007087 3.900638773383484 5
        "Denmark" 1980 .16 .0286298 .0225727 .0174416 .034341 .0417898 .0171904 .28 13833.123519561314 4.14092025488488 5
        "Denmark" 1985 .2 .0358484 .0230552 .0229473 .0504108 .0501007 .0214507 .3 12167.454354796877 4.085199725698612 5
        "Denmark" 1990 .19 .0302906 .0182385 .0243756 .0551302 .0470583 .0178743 .4 26861.799586687826 4.429135104549672 5
        "Denmark" 1995 .21 .0304347 .0214187 .0339992 .0548459 .0498821 .0233146 .43 35351.38070653458 4.548406380552129 5
        "Denmark" 2000 .25 .0389258 .0234698 .0430731 .0621963 .0600633 .0219751 .44 30743.559173584672 4.487754144229769 5
        "Denmark" 2005 .29 .0429946 .0291907 .0567307 .0723157 .0677615 .0227742 .43 48816.835863964516 4.688569626548733 5
        "Denmark" 2010 .3 .0422636 .0340746 .0687828 .0655799 .0720902 .0293285 .44 57647.66876206502 4.76078174937153 5
        "Finland" 1970 .09 .0103165 .0086787 .0285404 .018083 .0154403 .0073127 .08 2467.4763465361557 3.39225299817326 6
        "Finland" 1975 .11 .0114027 .0109052 .0405717 .0249213 .0169323 .0089078 .23 6260.1912785093255 3.7965876031676156 6
        "Finland" 1980 .13 .0133391 .0105371 .0490488 .0294601 .0180463 .0110984 .33 11232.274564421976 4.05046771091429 6
        "Finland" 1985 .14 .013331 .0108624 .0539466 .0330469 .0175716 .0105973 .27 11405.93365060346 4.057130840924293 6
        "Finland" 1990 .16 .0144728 .0121168 .059987 .0397009 .0194839 .0124495 .29 28380.548911274975 4.4530207909393695 6
        "Finland" 1995 .24 .0210581 .0175898 .0903679 .0624021 .0330914 .0202994 .27 26273.46590310658 4.4195173671639845 6
        "Finland" 2000 .29 .0226348 .0208604 .0944127 .0747812 .0439625 .0318822 .29 24253.250424578648 4.384769951056217 6
        "Finland" 2005 .32 .0243546 .0253742 .0961143 .0897261 .0504559 .0293571 .32 38969.17163181298 4.590721174087372 6
        "Finland" 2010 .33 .022717 .0291743 .0959823 .096257 .0522602 .0335412 .34 46205.16601118551 4.664690534965745 6
        "France" 1970 .07 .0116791 .0084286 .0132034 .0154938 .014891 .004568 .06 2862.4692677334656 3.456740832666575 7
        "France" 1975 .09 .0145681 .0106327 .0193285 .021114 .0193364 .0053803 .08 6672.511388164289 3.824289323682878 7
        "France" 1980 .09 .0129546 .0112238 .0224536 .0222709 .0190953 .0058495 .1 12712.60139947109 4.104234430005935 7
        "France" 1985 .12 .0143673 .0136561 .0306135 .0287568 .0239334 .0066856 .2 9775.339434530593 3.9901318465777966 7
        "France" 1990 .15 .0164859 .0165666 .0411251 .0363366 .0273175 .0088801 .28 21795.23782548333 4.338361612318215 7
        "France" 1995 .18 .0187051 .0205826 .0548873 .0459198 .0313194 .0118631 .33 27037.972131929168 4.431974116081039 7
        "France" 2000 .22 .0208995 .0234712 .0708994 .0570052 .0353881 .014428 .37 22465.641841463657 4.35151883086245 7
        "France" 2005 .24 .0208343 .0247334 .0795008 .0621854 .0362463 .0155556 .43 34879.726329189885 4.5425730687436445 7
        "France" 2010 .29 .0205586 .0277734 .0968007 .0780172 .0434471 .0223977 .43 40705.766229942106 4.609655934150674 7
        "Germany" 1970 .03 .0069202 .0029237 .0049376 .009075 .0055519 .0031466 .12 2750.7197423550365 3.4394463444613104 8
        "Germany" 1975 .06 .013489 .0053107 .0104333 .0175379 .0101931 .0060843 .13 6212.763126707891 3.793284795633917 8
        "Germany" 1980 .08 .0175747 .0065233 .0140357 .022958 .0136824 .0080491 .17 12092.381854294548 4.08251185291155 8
        "Germany" 1985 .1 .0193854 .0077603 .0173718 .0279254 .016685 .0092089 .21 9393.891690502365 3.972845548556584 8
        "Germany" 1990 .15 .0275476 .0109283 .0270206 .0430283 .0241178 .0130315 .31 22219.572527148575 4.346735699479451 8
        "Germany" 1995 .18 .0311757 .0132925 .0365894 .0541047 .0313874 .0154467 .4 31729.699763345136 4.5014659626853675 8
        "Germany" 2000 .21 .0341979 .0151681 .0442169 .0601704 .0365366 .0161839 .46 23718.74669947103 4.375091737142305 8
        "Germany" 2005 .21 .0325673 .0156013 .0488612 .0618601 .0384294 .0155454 .58 34696.62091671001 4.540287181168836 8
        "Germany" 2010 .24 .0361934 .0182155 .0560185 .0710092 .0459496 .0171071 .6 41788.04478530844 4.6210520514782445 8
        "Greece" 1970 .05 .0130188 .0075367 .0115974 .0070425 .0058041 .0070575 .2 1494.387855253488 3.1744633294308344 9
        "Greece" 1975 .07 .0167542 .0102647 .0170088 .0117878 .0084465 .0094051 .18 3153.235305747165 3.498756380571721 9
        "Greece" 1980 .1 .0192883 .0138114 .0248492 .017289 .0119211 .0130076 .17 5893.661809791607 3.770385211535076 9
        "Greece" 1985 .12 .0213924 .0163553 .0305248 .0213111 .0138198 .0143325 .26 4813.711179910685 3.6824800292846835 9
        "Greece" 1990 .14 .0218092 .0187188 .0367231 .0278324 .0175369 .0211593 .34 9600.185129659685 3.9822796080410696 9
        "Greece" 1995 .17 .0214387 .024102 .0451688 .0344454 .0214839 .0230766 .33 12959.324318661924 4.112582358608154 9
        "Greece" 2000 .17 .0188323 .0231891 .0488758 .0372244 .0211509 .0253501 .37 12042.953731099451 4.0807330178015535 9
        "Greece" 2005 .28 .0260581 .0355587 .0782123 .0617359 .0361208 .0381847 .35 22551.735744099024 4.353179973933429 9
        "Greece" 2010 .32 .0277858 .0417789 .0941235 .0757834 .0397126 .0398477 .35 26919.361636775695 4.430064756855322 9
        "Iceland" 1970 .07 .0194101 .0112531 .0088719 .0170335 .0087521 .0025047 .12 2597.387271891278 3.414536708006715 10
        "Iceland" 1975 .08 .0248335 .0134688 .014458 .0176282 .0112881 .0061167 .16 6506.866772930795 3.8133719147139806 10
        "Iceland" 1980 .11 .0250478 .016588 .0240828 .0213757 .0208259 .0053461 .18 14942.813995694161 4.174432390499667 10
        "Iceland" 1985 .13 .0321299 .0198006 .0232923 .0320812 .0220905 .0069891 .21 12462.098794652857 4.095591189849452 10
        "Iceland" 1990 .16 .0349667 .0209163 .0324801 .0334192 .0248178 .0130973 .25 25592.14714827476 4.408106724164986 10
        "Iceland" 1995 .19 .0362286 .0291413 .0419877 .0436397 .0290825 .0135796 .27 26851.01722026353 4.428960743099976 10
        "Iceland" 2000 .23 .0441357 .0388983 .0475555 .0546607 .0334673 .016568 .28 31737.470609749802 4.501572311706768 10
        "Iceland" 2005 .3 .051695 .0436055 .0802896 .0672917 .0410437 .0207139 .27 56445.53613716343 4.751629602458473 10
        "Iceland" 2010 .39 .0688078 .0741954 .1009664 .0773837 .0556529 .0260789 .24 41620.06745372957 4.619302779738145 10
        "Ireland" 1970 .06 .0121669 .0077863 .0103287 .0102601 .0152393 .0071031 .18 1487.9854342192662 3.1725986799537047 11
        "Ireland" 1975 .08 .0150409 .0098952 .014331 .0134997 .0184217 .0079238 .21 2976.342276719538 3.4736828732256577 11
        "Ireland" 1980 .11 .0182568 .0116657 .0220363 .0203406 .023186 .010991 .25 6378.743586685298 3.8047351446922635 11
        "Ireland" 1985 .15 .0241177 .0151219 .0333264 .030872 .0277424 .014556 .27 6017.684218419656 3.779429394139177 11
        "Ireland" 1990 .19 .0269281 .0188315 .0460432 .0425137 .0323159 .019783 .28 14045.186730973419 4.147527517527791 11
        "Ireland" 1995 .25 .0320364 .0261591 .0691669 .0611463 .0414221 .0241568 .28 19177.414164298458 4.282790047574732 11
        "Ireland" 2000 .29 .033418 .0284543 .0847742 .0750033 .0445531 .028304 .3 26241.9184947821 4.418995582275276 11
        "Ireland" 2005 .35 .0390755 .0347218 .1052843 .0905987 .0510231 .0317819 .32 50886.82729270094 4.706605374193666 11
        "Ireland" 2010 .48 .0505698 .0472677 .1545629 .1171467 .0677955 .0464073 .27 48541.47764423687 4.686112992493871 11
        "Italy" 1970 .03 .0038038 .0077421 .005704 .0047301 .0034236 .0011802 .09 2099.914302734337 3.322201571586772 12
        end

        I have data for OECD countries. The variables are:

        Lh =proportion labor force with higher education
        Lsc= proportion labor force with youth education but not a higher education.
        Lh1= proportion teachers
        Lh2= proportion humanities
        Lh3= proportion social science, law and trade
        Lh4= proportion science, technology, engineering, manufacturing
        Lh5= proportion health education
        Lh6= others

        I want to regress these on the variable: Natural log to GDP pr. capita to see which educations have the highest impact on economic growth. However when i do the regression in STATA with fixed effects and year dummies i get some strange results seen in the picture bellow. I get negative coefficients and it seems a bit strange, i think its because of omitted variables but i am not sure, how can i make the results better?

        I ran the code: XTREG Lngdpprcapita lh1 lh2 lh3 lh4 lh5 lh6 i.year, FE

        Click image for larger version

Name:	stata picture.png
Views:	1
Size:	22.2 KB
ID:	1382877


        Thank you, any help is welcome.







        Comment


        • #5
          Well, it doesn't look like you're doing anything wrong from a Stata coding perspective, nor does Stata seem to be producing incorrect results given what you have given it. I think you are just trying to fit a very simple model to a very complex situation and, accordingly, getting unhelpful answers.

          First remember that fixed-effects estimation is within panel estimation. So you are modeling the time trends in GDP per capita (on a log scale) as a linear combination of time trends in people with certain types of education. While most people would probably agree that there is some relationship there, I think most people would also agree that these variables would only account for a very small fraction of the determinants of GDP per capita. By using a fixed effects model, you are also implicitly adjusting the model for any time-invariant attributes of countries. There are many such attributes, and many of them are probably associated with the GDP outcome. While that can be a good thing, some of them undoubtedly also lie on the causal pathway (assuming there is one) between education and per capita GDP. Adjusting for factors that mediate the education GDP relationship, whether explicitly or implicitly, will give misleading results. Moreover, there are probably other factors that differ among countries and are associated with per capita GDP that are not time invariant, and you are not adjusting for any of these. So, I think that you have both omitted variable bias, and over-adjustment for mediating variables at the same time. I don't see any way around these problems using only these variables.

          Comment


          • #6
            Thank you so much for your response Clyde. I just have one last question, given the data and if you had to find a relationship, would you use the same approach as me or should i do something differently given that i only have this dataset available ?

            Comment


            • #7
              Well, if I had to work with this data set and couldn't just say no, I'd think that my chances of getting something useful out of it would be better by averaging each country's data over the years and modeling those. (You can do that in one step, by the way, with -xtreg, be-.) My gut feeling (which may not be worth much as I am no economist/econometrician) is that trying to relate increments of education in time to increments in GDP over time is harder and requires better data than just looking at aggregated means over time among the countries. Of course, you don't have that many countries in your data set. (I assume you have more than the 12 shown in your example.) But I think that might be as close to a silk purse as I could come starting from this sow's ear.

              Comment

              Working...
              X