Announcement

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

  • Troubles with random effects regression

    Hello everyone,

    I am writing a paper for a class at university, looking at wether right oppositions can pressure left governments into not following their preferred policy on corporate tax, by emphasising it in their election manifestos. (18 countries across 20 years)

    In that context I wanted to use either random or fixed effects to control for non-observable country caracteristica, as advised by my professor. However I have run into a problem I can't seem to understand.

    When I do a regression without either RE or FE, I get the results I expected. (As seen below) Left governments raise taxes, and my interaction variable lowers the effect. (Emphasis)

    However when I run a random effects regression my results flip entirely, which makes very little sense to me. I did a Hausman test to confirm that I shouldn't use Fixed effects, and a Breusch-Pagan Lagrange multiplier test to confirm that Random effects was appropriate.


    I hope you can help me understand what is happening. I have included my results below.

    Thanks in advance.



    xtpcse corporatetax_L1 c.gov_left1##c.wtmean_r realgdpgr capb, correlation(psar1)

    Prais–Winsten regression, correlated panels corrected standard errors (PCSEs)

    Group variable: countryn Number of obs = 482
    Time variable: year Number of groups = 18
    Panels: correlated (unbalanced) Obs per group:
    Autocorrelation: panel-specific AR(1) min = 20
    Sigma computed by casewise selection avg = 26.777778
    max = 29
    Estimated covariances = 171 R-squared = 0.3051
    Estimated autocorrelations = 18 Wald chi2(5) = 8.12
    Estimated coefficients = 6 Prob > chi2 = 0.1495

    ----------------------------------------------------------------------------------------
    Panel-corrected
    corporatetax_L1 | Coefficient std. err. z P>|z| [95% conf. interval]
    -----------------------+----------------------------------------------------------------
    gov_left1 | .0041539 .0024696 1.68 0.093 -.0006864 .0089942
    wtmean_r | -.021226 .0260811 -0.81 0.416 -.072344 .029892

    c.gov_left1#c.wtmean_r | -.0003106 .0004389 -0.71 0.479 -.0011708 .0005496

    realgdpgr | -.0136995 .0124339 -1.10 0.271 -.0380695 .0106705
    capb .0026811 .0095016 0.28 0.778 -.0159417 .0213039
    _cons | 2.689837 .2048725 13.13 0.000 2.288295 3.09138
    ----------------------------------------------------------------------------------------
    rhos = .8825862 .9336591 .762878 .7344527 .7447261 ... .9564357
    ----------------------------------------------------------------------------------------

    Random effects regression

    xtreg corporatetax_L1 c.gov_left1##c.wtmean_r realgdpgr capb, re

    Random-effects GLS regression Number of obs = 482
    Group variable: countryn Number of groups = 18

    R-squared: Obs per group:
    Within = 0.0277 min = 20
    Between = 0.1258 avg = 26.8
    Overall = 0.0010 max = 29

    Wald chi2(5) = 12.44
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0292

    ----------------------------------------------------------------------------------------
    corporatetax_L1 | Coefficient Std. err. z P>|z| [95% conf. interval]
    -----------------------+----------------------------------------------------------------
    gov_left1 | -.0022842 .0026225 -0.87 0.384 -.0074242 .0028559
    wtmean_r | -.0227211 .0336918 -0.67 0.500 -.0887557 .0433135
    |
    c.gov_left1#c.wtmean_r | .0010322 .0006271 1.65 0.100 -.0001968 .0022612
    |
    realgdpgr | -.0011676 .0169248 -0.07 0.945 -.0343395 .0320043
    capb | .0412132 .0157579 2.62 0.009 .0103282 .0720982
    _cons | 2.986988 .3677342 8.12 0.000 2.266242 3.707734
    -----------------------+----------------------------------------------------------------
    sigma_u | 1.4373903
    sigma_e | .93697765
    rho | .70179289 (fraction of variance due to u_i)
    ----------------------------------------------------------------------------------------



  • #2
    Mikel, your output is very hard to read. Please repost using code tags. See the Statalist FAQ.

    if I am reading this correctly, all of the Z values arre pretty small. If so a sign flip is not that surprising when you use a different methods.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 18.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Hi Richard. I have tried to take screenshots, I hope they are visible to you.

      I see your point about the very small Z values, however my confusion also arises from the other values flipping - and the substantial interpretation of the results.

      Regression without random effects.

      Click image for larger version

Name:	Screenshot 2022-01-01 at 22.40.59.png
Views:	1
Size:	486.2 KB
ID:	1643282



      Regression with random effects.

      Click image for larger version

Name:	Screenshot 2022-01-01 at 22.39.22.png
Views:	1
Size:	436.5 KB
ID:	1643281

      Comment


      • #4
        Mikkel:
        as an aside to Richard's helpful advice:
        1) you used two very different estimators, that offer very different options for the correlation structure of the systematic error;
        2) you're seemingly dealing with a T>N panel dataset, whereas -xtreg- was conceived for N>T panel datasets and, unlike -xtpcse-, does not allow modelling across panel correlation of the systematic error, but within panel correlation only of the epsilon term.
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          Thank you Carlo and Richard, that was very helpful. Could you perhaps explain a better way to use random/fixed effects seeing as using xtreg is not appropriate for my data? That would be much appreciated

          Comment


          • #6
            Mikkel:
            -xtreg- was actually developed for short (N>T) datasets, whereas you are dealing with a T>N design.
            In addition to -xtpcse., there're other Stata built-in command for such panels (-xtregar-, that allows both -fe- and -re- specifications; -xtgls-).
            Kind regards,
            Carlo
            (StataNow 18.5)

            Comment


            • #7
              There's nothing wrong with FE when you have T larger or similar to N. The issue is in computing the standard errors. And the Hausman test can't tell you what to do. This data structure cries out for two-way fixed effects, where you use xtreg and also i.year. But per Carlo's point, you need to think about computing standard errors. With small N and T there aren't many good choices. But I would try vce(cluster country) and I would also try the Discoll-Kraay standard errors, available through the user-written command xtscc. The latter uses a Newey-West estimator across time. But for the coefficients, fixed effects is almost necessary with country-level data.

              Here's a twitter post I made about it:

              https://twitter.com/jmwooldridge/sta...33254859177988

              In terms of commands such as -xtregar-, these are constructed often without thinking enough about statistical properties. GLS estimators require large sample sizes. Here T is not much bigger than N. I would avoid GLS, use two-way fixed effects, and compute the standard errors a couple of different ways.

              Comment


              • #8
                Thanks, Jeff.
                Kind regards,
                Carlo
                (StataNow 18.5)

                Comment


                • #9
                  Thanks for your input Jeff. I have noted your point and I will not use that logic about the random effects I very much appreciate everyone taking the time to answer

                  Comment

                  Working...
                  X