Announcement

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

  • How to choose between Pooled OLS/Random Effects?

    Hello,

    I am currently working on my undergrad thesis with the topic factor determinants for imports with panel data of 7 countries and 16 periods (2003-2018), and I am a beginner in econometrics as well as using STATA. There are six variables I used in the model, and I tried to run PLS, Fixed, and Random. The Hausman test suggested using random effects. Here below is the output for Random effects

    . xtreg imp gdp pro p ex cons gdpj, robust

    Random-effects GLS regression Number of obs = 112
    Group variable: neg Number of groups = 7

    xtreg imp gdp pro p ex cons gdpj, robust

    Random-effects GLS regression Number of obs = 112
    Group variable: neg Number of groups = 7

    R-sq: Obs per group:
    within = 0.0434 min = 16
    between = 0.9911 avg = 16.0
    overall = 0.7899 max = 16

    Wald chi2(6) = 1161.56
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000

    (Std. Err. adjusted for 7 clusters in neg)
    ------------------------------------------------------------------------------
    | Robust
    imp | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    gdp | .3827558 .0384292 9.96 0.000 .307436 .4580757
    pro | .351964 .0729127 4.83 0.000 .2090577 .4948703
    p | -.304284 .4000822 -0.76 0.447 -1.088431 .4798627
    ex | -.0060916 .0239385 -0.25 0.799 -.0530103 .040827
    cons | -1.558034 3.330587 -0.47 0.640 -8.085865 4.969797
    gdpj | 2.20647 5.615751 0.39 0.694 -8.800199 13.21314
    _cons | 1.985671 22.32831 0.09 0.929 -41.777 45.74835
    -------------+----------------------------------------------------------------
    sigma_u | 0
    sigma_e | .41758527
    rho | 0 (fraction of variance due to u_i)
    ----------------------------------------------------------------------------

    which gdp stands for exporter's GDP, pro as exporter's production, p as export's price, ex as exchange rates, cons as importer's consumption, gdpj as importer's GDP. I also run the Breusch-Pagan LM test for the same model (neg as cross-section countries)

    . quietly xtreg imp gdp pro p ex cons gdpj, re i(neg)

    . xttest0

    Breusch and Pagan Lagrangian multiplier test for random effects

    imp[neg,t] = Xb + u[neg] + e[neg,t]

    Estimated results:
    | Var sd = sqrt(Var)
    ---------+-----------------------------
    imp | .7844583 .8856965
    e | .1743775 .4175853
    u | 0 0

    Test: Var(u) = 0
    chibar2(01) = 0.00
    Prob > chibar2 = 1.0000


    My questions are:

    1. what's sigma_u and rho actually indicates? is it evidence that there were no individual effects?
    2. I have limited proficiency in English, and I couldn't grasp the main idea of why chibar2(01) value is 0. Is that mean the model actually not quite right?
    3. If turns out the LM test is valid, is that mean PLS is preferred? but I read somewhere on the internet that PLS actually not suitable for panel data (as if means nothing).
    Last edited by Gentur Ngudiharjo; 26 Aug 2020, 23:41.

  • #2
    Gentur:
    welcome to this forum.
    1) 2) your results rule out any panel-wise effect. hence, you should go POLS.
    3) POLS is actually the only way to go given 1) and 2).

    As an aside, you do not specify why you invoked non-default standard errors: anyway, with 7 panels only, they could be more misleading than their defauls counterparts.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you! But I did altered the data and put another country into consideration for better results. Now I have 10 cross-sections with 13 periods (2005-2018). Then I encountered the issues regarding heteroskedasticity and autocorrelation. I'm using -xtreg, fe vce(cluster id)- then compared with -xtreg, fe robust-. The results are very different.

      Code:
      xi: regress imp pro p ex cons gdpj gdp pdun i.neg, vce(cluster negara)
      i.neg             _Ineg_1-10          (naturally coded; _Ineg_1 omitted)
      
      Linear regression                               Number of obs     =        140
                                                      F(6, 9)           =          .
                                                      Prob > F          =          .
                                                      R-squared         =     0.8457
                                                      Root MSE          =     .68863
      
                                      (Std. Err. adjusted for 10 clusters in negara)
      ------------------------------------------------------------------------------
                   |               Robust
               imp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               pro |   .6174681   .6195354     1.00   0.345    -.7840183    2.018954
                 p |  -1.725985    .967985    -1.78   0.108     -3.91572    .4637489
                ex |   1.657856   1.241732     1.34   0.215    -1.151138     4.46685
              cons |  -3.722098   4.133393    -0.90   0.391    -13.07248    5.628287
              gdpj |  -3.437519    4.99803    -0.69   0.509    -14.74385    7.868811
               gdp |   3.754031   2.281259     1.65   0.134    -1.406535    8.914597
              pdun |   2.036045   1.360581     1.50   0.169    -1.041802    5.113893
           _Ineg_2 |   15.12211   10.93471     1.38   0.200    -9.613927    39.85815
           _Ineg_3 |   7.553953    5.85702     1.29   0.229    -5.695546    20.80345
           _Ineg_4 |   8.599554   7.676992     1.12   0.292    -8.767008    25.96612
           _Ineg_5 |   18.00314   13.66016     1.32   0.220    -12.89829    48.90458
           _Ineg_6 |   13.89169   10.37895     1.34   0.214    -9.587119    37.37051
           _Ineg_7 |   20.09132   17.24786     1.16   0.274    -18.92606    59.10869
           _Ineg_8 |   1.104143   3.424988     0.32   0.755    -6.643717    8.852004
           _Ineg_9 |     20.946   15.90757     1.32   0.220    -15.03942    56.93142
          _Ineg_10 |   21.54675   15.71969     1.37   0.204    -14.01365    57.10716
             _cons |   44.11078   57.56534     0.77   0.463    -86.11107    174.3326
      ------------------------------------------------------------------------------
      with the one -xtreg, fe robust-

      Code:
      . xi: regress imp pro p ex cons gdpj gdp pdun i.neg, robust
      i.neg             _Ineg_1-10          (naturally coded; _Ineg_1 omitted)
      
      Linear regression                               Number of obs     =        140
                                                      F(16, 123)        =      55.91
                                                      Prob > F          =     0.0000
                                                      R-squared         =     0.8457
                                                      Root MSE          =     .68863
      
      ------------------------------------------------------------------------------
                   |               Robust
               imp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
               pro |   .6174681   .4289125     1.44   0.153    -.2315379    1.466474
                 p |  -1.725985   .9587962    -1.80   0.074    -3.623864     .171893
                ex |   1.657856   .6336327     2.62   0.010     .4036193    2.912093
              cons |  -3.722098   3.617984    -1.03   0.306    -10.88368    3.439479
              gdpj |  -3.437519    3.87112    -0.89   0.376    -11.10016    4.225124
               gdp |   3.754031   1.126391     3.33   0.001     1.524409    5.983654
              pdun |   2.036045   1.106675     1.84   0.068      -.15455    4.226641
           _Ineg_2 |   15.12211   5.171313     2.92   0.004     4.885814    25.35841
           _Ineg_3 |   7.553953   2.867827     2.63   0.010     1.877265    13.23064
           _Ineg_4 |   8.599554     3.6794     2.34   0.021     1.316407     15.8827
           _Ineg_5 |   18.00314   6.717734     2.68   0.008       4.7058    31.30049
           _Ineg_6 |   13.89169   5.213554     2.66   0.009     3.571784     24.2116
           _Ineg_7 |   20.09132   8.149504     2.47   0.015     3.959872    36.22276
           _Ineg_8 |   1.104143   1.760794     0.63   0.532    -2.381241    4.589527
           _Ineg_9 |     20.946   7.670806     2.73   0.007     5.762105    36.12989
          _Ineg_10 |   21.54675   7.571491     2.85   0.005     6.559449    36.53405
             _cons |   44.11078   27.89612     1.58   0.116    -11.10787    99.32943
      ------------------------------------------------------------------------------
      With the new data, I ran the Hausman test and it said that Fixed Effect is preferred. What I have read from previous threads said that -xtreg, vce (cluster id)- much better because it solves heteroskedasticity and serial correlation. But with this result, does Hausman actually suggested the right model? and is there any command that might be suitable with at least 2 variables that significant? or do I should find other variables? (I do need -i.country- because that will be part of my explanation. I also ran the F-test and it said that there are fixed group effects in the model). Thank you in advance!!

      Comment


      • #4
        Gentur:
        as far as I can see from your codes, you're not using -xtreg,fe- but -regress-.
        In fact, had you used -xtreg- with robust or clustered standard errors, the results would have been the same, as you can see from the following toy-example:
        Code:
        . use "https://www.stata-press.com/data/r16/nlswork.dta"
        (National Longitudinal Survey.  Young Women 14-26 years of age in 1968)
        
        . xtreg ln_wage c.age##c.age, robust
        
        Random-effects GLS regression                   Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-sq:                                           Obs per group:
             within  = 0.1087                                         min =          1
             between = 0.1015                                         avg =        6.1
             overall = 0.0870                                         max =         15
        
                                                        Wald chi2(2)      =    1258.33
        corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
        
                                     (Std. Err. adjusted for 4,710 clusters in idcode)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   .0590339   .0041049    14.38   0.000     .0509884    .0670795
                     |
         c.age#c.age |  -.0006758   .0000688    -9.83   0.000    -.0008107    -.000541
                     |
               _cons |   .5479714   .0587198     9.33   0.000     .4328826    .6630601
        -------------+----------------------------------------------------------------
             sigma_u |   .3654049
             sigma_e |  .30245467
                 rho |  .59342665   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . xtreg ln_wage c.age##c.age, vce(cluster idcode)
        
        Random-effects GLS regression                   Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-sq:                                           Obs per group:
             within  = 0.1087                                         min =          1
             between = 0.1015                                         avg =        6.1
             overall = 0.0870                                         max =         15
        
                                                        Wald chi2(2)      =    1258.33
        corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
        
                                     (Std. Err. adjusted for 4,710 clusters in idcode)
        ------------------------------------------------------------------------------
                     |               Robust
             ln_wage |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
                 age |   .0590339   .0041049    14.38   0.000     .0509884    .0670795
                     |
         c.age#c.age |  -.0006758   .0000688    -9.83   0.000    -.0008107    -.000541
                     |
               _cons |   .5479714   .0587198     9.33   0.000     .4328826    .6630601
        -------------+----------------------------------------------------------------
             sigma_u |   .3654049
             sigma_e |  .30245467
                 rho |  .59342665   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        .
        As an aside, -hausman- does not suppport non-default standard errors; hence it is a bit unclear (to me, at any rate) what you did.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Originally posted by Carlo Lazzaro View Post
          Gentur:
          welcome to this forum.
          1) 2) your results rule out any panel-wise effect. hence, you should go POLS.
          3) POLS is actually the only way to go given 1) and 2).

          As an aside, you do not specify why you invoked non-default standard errors: anyway, with 7 panels only, they could be more misleading than their defauls counterparts.
          Hi Carlo,

          If my dependent variable is a count variable and I use xtnbreg then I get the following output at the bottom of the main results.

          LR test vs. pooled: chibar2(01) = 1503.02 Prob >= chibar2 = 0.000
          But if I log transform the dependent variable and use xtreg, then I don't get this LR test vs. pooled results.

          Could you please tell why is this happening? The independent and control variables are same in both the models.

          How to interpret the LR test for xtnbreg?

          Thanks.


          Comment


          • #6
            Nitin:
            1) there's no scope in comparing -xtnbreg- vs. -xtreg-: different estimators give back different results;
            2) more substantively, the LR test that -xtnbreg- gave you back highlighted the evidence of a panel-wise effect (put differently, your count pane estimator is bettere than its pooled counterpart: tehrefore, go -xtnbreg-).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Originally posted by Carlo Lazzaro View Post
              Nitin:
              1) there's no scope in comparing -xtnbreg- vs. -xtreg-: different estimators give back different results;
              2) more substantively, the LR test that -xtnbreg- gave you back highlighted the evidence of a panel-wise effect (put differently, your count pane estimator is bettere than its pooled counterpart: tehrefore, go -xtnbreg-).
              Thank you, Carlo. But how do we get results similar to LR test for xtreg to justify using re/fe over pooled models? Secondly, if the within variance is much more than the between variance but the Hausman test rejects Ho, then how do we model? Thanks.

              Comment


              • #8
                Nitin:
                1)the F-test appearing as a footnote after -xtreg,fe- (with default standard errors) and -xtttest0- after -xtreg,re- (no matter the type of standard error), if ststistical significant, cinfirm the ecidence of a panel-wise effect;
                2) if the -hausman- rejects the null, you shuould go -fe- (provided that you have evidence of a panel-wise effect).
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Originally posted by Carlo Lazzaro View Post
                  Nitin:
                  1)the F-test appearing as a footnote after -xtreg,fe- (with default standard errors) and -xtttest0- after -xtreg,re- (no matter the type of standard error), if statistical significant, confirm the evidence of a panel-wise effect;
                  2) if the -hausman- rejects the null, you shuould go -fe- (provided that you have evidence of a panel-wise effect).
                  Thanks, Carlo. I just found out a method called "correlated random effects". Do you think this could be applied in a situation where the theory/conceptual framework supports a random effect, the between variance is also relatively higher than then within variance but the Hausman test rejects Ho. Is it possible that the Hausman test can give incorrect results if any assumptions are not met?

                  Comment


                  • #10
                    Nitin:
                    -hausman- works well asymptotically: therefore, its outcomes can be unreliable if some assumptions are not met.
                    That said, if -hausman- rejects the null, you can double-check this result via the community-contributed module -xtoverid- (null: random effect is the way to go).
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Originally posted by Carlo Lazzaro View Post
                      Nitin:
                      -hausman- works well asymptotically: therefore, its outcomes can be unreliable if some assumptions are not met.
                      That said, if -hausman- rejects the null, you can double-check this result via the community-contributed module -xtoverid- (null: random effect is the way to go).
                      Thanks Carlo. I am using xtnbreg. Could you please tell what could I use in lieu of xtoverid?

                      Comment


                      • #12
                        Nitin:
                        the "“hybrid method” decribed here https://statisticalhorizons.com/fe-nbreg/ (which is similar to the Mundlak approach for panel data regression with continuous regressands; see
                        https://blog.stata.com/2015/10/29/fi...ndlak-approach) might be the way to go (keeping in ming that with non-linera model -fe- reads -conditional fe-).
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Originally posted by Carlo Lazzaro View Post
                          Nitin:
                          the "“hybrid method” decribed here https://statisticalhorizons.com/fe-nbreg/ (which is similar to the Mundlak approach for panel data regression with continuous regressands; see
                          https://blog.stata.com/2015/10/29/fi...ndlak-approach) might be the way to go (keeping in ming that with non-linera model -fe- reads -conditional fe-).
                          Thank you, Carlo. I am using a negative binomial panel model with control function approach. So, when I am using the mundlak test, do I need to keep the errors from the first stage in the model?

                          Comment


                          • #14
                            Nitin:
                            unfortunately I cannot help you on that.
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #15
                              Originally posted by Carlo Lazzaro View Post
                              Nitin:
                              unfortunately I cannot help you on that.
                              Ok, no problem, Carlo. Would you anyone whom I could approach for guidance on this? Thanks, Nitin

                              Comment

                              Working...
                              X