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

  • reg or xtreg for unbalanced panel data?


    I have an unbalanced panel dataset for 2000+ companies from 1992-2018. Following was the xtset output:

    panel variable: company_id (unbalanced)
    time variable: fiscalyear, 1992 to 2018, but with gaps
    delta: 1 unit

    xtreg command is giving results that are very much different from reg command. If the dataset is very unbalanced, should I proceed with reg or xtreg?


  • #2
    Whether the panel is balanced or unbalanced has no bearing on the appropriateness of using -xtreg-.

    -reg- and -xtreg- estimate different models with different parameters being estimated. While they sometimes produce similar results, they need not do so, and often do not do so.

    Given that you have panel data, -reg- is simply inappropriate, unless the final output of -xtreg- where you get sigma_u and sigma_e shows sigma_u (and rho) to be 0 or very close to 0. But that won't happen here, because when that does happen, -reg- and -xtreg- produce the same results (or very nearly the same to small rounding errors). Unless sigma_u = 0, -reg- is simply an invalid, mis-specified analysis for panel data.

    Now those are the general principles. Since you do not actually show the commands or output for either, it is impossible to give you more specific advice here. In particular, it may be that you have made mistakes in coding, or that there are other problems that are affecting the results you see. So if you would like more specific advice, post back showing the exact commands you ran and the exact output you got from Stata. Do that by copy/pasting directly from Stata's Results window or your log file into the forum editor, between code delimiters. (If you are not familiar with code delimiters, read Forum FAQ #12 for instructions.)


    • #3
      Click image for larger version

Name:	12.png
Views:	1
Size:	16.0 KB
ID:	1504683

      Click image for larger version

Name:	123.png
Views:	1
Size:	24.3 KB
ID:	1504684

      These were the outputs for both reg and xtreg. I guess xtreg would be the appropriate command for me. Any advice on how to improve these results?


      • #4
        -regress- would clearly be quite wrong here. sigma_u is quite large, and rho, at .63 is also.

        I don't know what you would consider an "improvement" in the results. The results are what they are. Have you looked at how the modeled results fit the data? A better fit would typically mean finding a better model that is a closer approximation to the real data generating process. That in turn requires insight into the underlying mechanisms.


        • #5
          By improvement, I meant if it is possible to find higher individual variable p-values through ways i.e. winsorizing etc.


          • #6
            your goal (like the one of everybody else engaged in inferential statistics) should be to give a fair and true view of the data generating process instead of hunting for the model with the highest numbero of statistically significant coefficients. I do agree with the contents of and I take the chance to thank Clyde Schechter to wisely remind us of this document oftentimes.
            Kind regards,
            (Stata 17.0 SE)


            • #7
              Thank you very much! Really appreciate the assistance from both of you!