Announcement

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

  • Random Effects & Pooled OLS results the same in panel data analysis

    Hi,

    This is my first post here and I'm relatively new to stata. I'm doing some panel data analysis and my fixed effect, random effects and pooled ols results are all relatively similar (although RE & OLS are identical). Why might this be the case and how can I correct for it?

  • #2
    It might just be that there isn't much variation by panel. Or, you might be doing something wrong. Without seeing the actual output, it's really impossible to say. Please show the exact commands you gave and the exact response you got from Stata. To insure readability and fidelity, do this by copying from the Results window or your log file to the clipboard and then paste that into a code block on the Forum. If you don't know how to set up a code block, see FAQ #12, 7th paragraph for instructions. Please do not edit or in any way modify. There are no unimportant details.

    Comment


    • #3
      If you have some variables that change over time, and RE and POLS are identical, I suspect it is because there is negative serial correlation in the residuals. For example, maybe the dependent and/or independent variables are differences. In any case, when a negative variance is estimated for the unobserved effect, Stata sets it to zero. Which means RE becomes pooled OLS.

      But like Clyde said, seeing the Stata output would help a lot.

      Comment


      • #4
        Apologies for the delay - I did not have access to Stata.

        Here's the output:
        Code:
        . xtset countryp year
               panel variable:  countryp (strongly balanced)
                time variable:  year, 1970 to 2005, but with gaps
                        delta:  1 unit
        
        . xtreg growth giniincome schoolyrs gdpus2005
        
        Random-effects GLS regression                   Number o
        > f obs     =        368
        Group variable: countryp                        Number o
        > f groups  =         46
        
        R-sq:                                           Obs per 
        > group:
             within  = 0.3320                                   
        >       min =          8
             between = 0.0211                                   
        >       avg =        8.0
             overall = 0.0556                                   
        >       max =          8
        
                                                        Wald chi
        > 2(3)      =     135.61
        corr(u_i, X)   = 0 (assumed)                    Prob > c
        > hi2       =     0.0000
        
        --------------------------------------------------------
        > ----------------------
              growth |      Coef.   Std. Err.      z    P>|z|   
        >   [95% Con                                            
        >           f. Interval]
        -------------+------------------------------------------
        > ----------------------
          giniincome |  -.0119427   .0100119    -1.19   0.233   
        >  -.0315658                                            
        >               .0076803
           schoolyrs |   .1711932   .0304771     5.62   0.000   
        >   .1114592                                            
        >               .2309272
           gdpus2005 |  -.0000927   8.20e-06   -11.30   0.000   
        >  -.0001088                                            
        >              -.0000766
               _cons |   2.668791   .4849675     5.50   0.000   
        >   1.718273                                            
        >                3.61931
        -------------+------------------------------------------
        > ----------------------
             sigma_u |  1.1781187
             sigma_e |  .65951429
                 rho |  .76139466   (fraction of variance due to
        >  u_i)
        --------------------------------------------------------
        > ----------------------
        
        . xtreg growth giniincome schoolyrs gdpus2005
        
        Random-effects GLS regression                   Number o
        > f obs     =        368
        Group variable: countryp                        Number o
        > f groups  =         46
        
        R-sq:                                           Obs per 
        > group:
             within  = 0.3320                                   
        >       min =          8
             between = 0.0211                                   
        >       avg =        8.0
             overall = 0.0556                                   
        >       max =          8
        
                                                        Wald chi
        > 2(3)      =     135.61
        corr(u_i, X)   = 0 (assumed)                    Prob > c
        > hi2       =     0.0000
        
        --------------------------------------------------------
        > ----------------------
              growth |      Coef.   Std. Err.      z    P>|z|   
        >   [95% Con                                            
        >           f. Interval]
        -------------+------------------------------------------
        > ----------------------
          giniincome |  -.0119427   .0100119    -1.19   0.233   
        >  -.0315658                                            
        >               .0076803
           schoolyrs |   .1711932   .0304771     5.62   0.000   
        >   .1114592                                            
        >               .2309272
           gdpus2005 |  -.0000927   8.20e-06   -11.30   0.000   
        >  -.0001088                                            
        >              -.0000766
               _cons |   2.668791   .4849675     5.50   0.000   
        >   1.718273                                            
        >                3.61931
        -------------+------------------------------------------
        > ----------------------
             sigma_u |  1.1781187
             sigma_e |  .65951429
                 rho |  .76139466   (fraction of variance due to
        >  u_i)
        --------------------------------------------------------
        > ----------------------
        
        . xtreg growth giniincome schoolyrs gdpus2005, fe
        
        Fixed-effects (within) regression               Number o
        > f obs                                                 
        >           =                                           
        >                    368
        Group variable: countryp                        Number o
        > f groups                                              
        >           =                                           
        >                     46
        
        R-sq:                                           Obs per 
        > group:
             within  = 0.3341                                   
        >       min                                             
        >           =                                           
        >                      8
             between = 0.0161                                   
        >       avg                                             
        >           =                                           
        >                    8.0
             overall = 0.0488                                   
        >       max                                             
        >           =                                           
        >                      8
        
                                                        F(3,319)
        >           =                                           
        >                  53.35
        corr(u_i, Xb)  = -0.5255                        Prob > F
        >           =                                           
        >                 0.0000
        
        --------------------------------------------------------
        > ----------------------
              growth |      Coef.   Std. Err.      t    P>|t|   
        >   [95% Con                                            
        >           f. Interval]
        -------------+------------------------------------------
        > ----------------------
          giniincome |  -.0130093   .0113308    -1.15   0.252   
        >  -.0353018                                            
        >               .0092832
           schoolyrs |   .2248358    .032007     7.02   0.000   
        >   .1618643                                            
        >               .2878073
           gdpus2005 |  -.0001077   8.87e-06   -12.14   0.000   
        >  -.0001251                                            
        >              -.0000902
               _cons |   2.523526   .4884427     5.17   0.000   
        >    1.56255                                            
        >               3.484502
        -------------+------------------------------------------
        > ----------------------
             sigma_u |  1.4849086
             sigma_e |  .65951429
                 rho |  .83523732   (fraction of variance due to
        >  u_i)
        --------------------------------------------------------
        > ----------------------
        F test that all u_i=0: F(45, 319) = 27.22               
        >      Prob > F = 0.0000
        
        . xtreg growth giniincome schoolyrs gdpus2005, re
        
        Random-effects GLS regression                   Number o
        > f obs     =        368
        Group variable: countryp                        Number o
        > f groups  =         46
        
        R-sq:                                           Obs per 
        > group:
             within  = 0.3320                                   
        >       min =          8
             between = 0.0211                                   
        >       avg =        8.0
             overall = 0.0556                                   
        >       max =          8
        
                                                        Wald chi
        > 2(3)      =     135.61
        corr(u_i, X)   = 0 (assumed)                    Prob > c
        > hi2       =     0.0000
        
        --------------------------------------------------------
        > ----------------------
              growth |      Coef.   Std. Err.      z    P>|z|   
        >   [95% Con                                            
        >           f. Interval]
        -------------+------------------------------------------
        > ----------------------
          giniincome |  -.0119427   .0100119    -1.19   0.233   
        >  -.0315658                                            
        >               .0076803
           schoolyrs |   .1711932   .0304771     5.62   0.000   
        >   .1114592                                            
        >               .2309272
           gdpus2005 |  -.0000927   8.20e-06   -11.30   0.000   
        >  -.0001088                                            
        >              -.0000766
               _cons |   2.668791   .4849675     5.50   0.000   
        >   1.718273                                            
        >                3.61931
        -------------+------------------------------------------
        > ----------------------
             sigma_u |  1.1781187
             sigma_e |  .65951429
                 rho |  .76139466   (fraction of variance due to
        >  u_i)
        --------------------------------------------------------
        > ----------------------
        
        . xtreg growth giniincome schoolyrs gdpus2005, re vce (r
        > obust)
        
        Random-effects GLS regression                   Number o
        > f obs     =        368
        Group variable: countryp                        Number o
        > f groups  =         46
        
        R-sq:                                           Obs per 
        > group:
             within  = 0.3320                                   
        >       min =          8
             between = 0.0211                                   
        >       avg =        8.0
             overall = 0.0556                                   
        >       max =          8
        
                                                        Wald chi
        > 2(3)      =      50.32
        corr(u_i, X)   = 0 (assumed)                    Prob > c
        > hi2       =     0.0000
        
                                      (Std. Err. adjusted for 46
        >  clusters in countryp)
        --------------------------------------------------------
        > ----------------------
                     |               Robust
              growth |      Coef.   Std. Err.      z    P>|z|   
        >   [95% Con                                            
        >           f. Interval]
        -------------+------------------------------------------
        > ----------------------
          giniincome |  -.0119427   .0211862    -0.56   0.573   
        >  -.0534669                                            
        >               .0295815
           schoolyrs |   .1711932    .059544     2.88   0.004   
        >    .054489                                            
        >               .2878974
           gdpus2005 |  -.0000927   .0000142    -6.51   0.000   
        >  -.0001206                                            
        >              -.0000648
               _cons |   2.668791   .8338707     3.20   0.001   
        >   1.034435                                            
        >               4.303148
        -------------+------------------------------------------
        > ----------------------
             sigma_u |  1.1781187
             sigma_e |  .65951429
                 rho |  .76139466   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------

        Comment


        • #5
          Well, thank you for showing us more detail. But what you've posted doesn't correspond to your question in #1. You have shown us the results of the random effects model three times. Stuck in the middle, there are the results for the fixed-effects regression, which are largely similar, as is often the case. Your original question was about the random effects model showing exactly the same results as OLS, but you don't show us the OLS results, so we can't comment on that. Suffice it to say that given the high value of rho, it is highly implausible that an OLS run on this same model will produce the same results that the random effects model did: it suggests you made a mistake of some kind with the OLS, but we can't say more without seeing that.

          Finally you show us the results of the random effects model with robust VCE. As expected, this produces exactly the same coefficient estimates as random effects with ordinary VCE, but different standard errors--that's what robust VCE does. But you never even mentioned this analysis in your original question, so I'm wondering why you have posted it here.
          Last edited by Clyde Schechter; 22 Mar 2016, 13:44. Reason: Correct typos.

          Comment


          • #6
            Andew:
            I agree with all previos comments.
            Just an aside: the significance of the F-test at the foot of the -xtreg,fe- outcome table rules out POLS.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Sorry to reopen this post, but the situation described below by Jeff just happened to me:

              Originally posted by Jeff Wooldridge View Post
              If you have some variables that change over time, and RE and POLS are identical, I suspect it is because there is negative serial correlation in the residuals. For example, maybe the dependent and/or independent variables are differences. In any case, when a negative variance is estimated for the unobserved effect, Stata sets it to zero. Which means RE becomes pooled OLS.
              That is, when running a pooled and a RE model, the two models give exactly the same results. Sigma_u is indeed set to zero in the RE model.

              Is there a way around this? How do I estimate a RE model for this specification? And how do I detect whether it's because of the dependent variable, or whether some regressor is causing it?

              I think my question does not require reporting any coding, I am in a typical situation as below:

              reg y x1 x2 x3

              xtreg y x1 x2 x3, re

              But if you need anything more than this, happy to show my stata codes.

              Thanks so much.

              Comment


              • #8
                Stefano:
                as usual, seeing Stata output will help.
                That said, I do not think that you should find any work-around: as per your data pooled OLS is one among the possible states of the world.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Here is my output:


                  . use database, clear
                  . preserve

                  .
                  . replace orderimb = orderimb/10000000
                  (2,655 real changes made)

                  .
                  . reg orderimb ///
                  > debt_GDP save_GDP export_GDP GDPg real_int sd_erate* ///
                  > danni* dmesi* ///
                  > Cap Capsq ForList DomList number_ETFs ETFsq number_DRs ///
                  > returns volatility ///
                  > returns_cac40 returns_ftse ///
                  > returns_dj VIX ///
                  > returns_MSCI_EM returns_MSCIFrontier ///
                  > correlation_dj correlation_cac40 correlation_ftse
                  note: danni13 omitted because of collinearity
                  note: dmesi9 omitted because of collinearity

                  Source | SS df MS Number of obs = 2,248
                  -------------+---------------------------------- F(49, 2198) = 7.46
                  Model | 2243982.23 49 45795.5558 Prob > F = 0.0000
                  Residual | 13500041.2 2,198 6141.96595 R-squared = 0.1425
                  -------------+---------------------------------- Adj R-squared = 0.1234
                  Total | 15744023.4 2,247 7006.68598 Root MSE = 78.371

                  --------------------------------------------------------------------------------------
                  orderimbalance_usd | Coef. Std. Err. t P>|t| [95% Conf. Interval]
                  ---------------------+----------------------------------------------------------------
                  debt_GDP | .222624 .0642685 3.46 0.001 .0965906 .3486574
                  save_GDP | .5229846 .319304 1.64 0.102 -.1031845 1.149154
                  export_GDP | -.088665 .1071196 -0.83 0.408 -.2987312 .1214013
                  GDPgrowth | 30.07946 31.8514 0.94 0.345 -32.38253 92.54145
                  real_interest | -376.5329 231.9006 -1.62 0.105 -831.3001 78.23434
                  sd_erate_eur_local | .0544178 .5065307 0.11 0.914 -.9389111 1.047747
                  sd_erate_gbp_local | -.0504349 .4447534 -0.11 0.910 -.9226158 .821746
                  sd_erate_usd_local | .1738648 .6477234 0.27 0.788 -1.096349 1.444079
                  danni1 | 30.80424 15.51111 1.99 0.047 .3862698 61.22222
                  danni2 | 14.99537 14.80921 1.01 0.311 -14.04614 44.03687
                  danni3 | 24.6064 15.92751 1.54 0.123 -6.628143 55.84094
                  danni4 | 14.27155 15.96148 0.89 0.371 -17.02962 45.57271
                  danni5 | 22.59426 14.50741 1.56 0.120 -5.855409 51.04392
                  danni6 | .1094486 14.39828 0.01 0.994 -28.12622 28.34511
                  danni7 | 21.02187 13.86401 1.52 0.130 -6.166061 48.2098
                  danni8 | 17.50801 13.82934 1.27 0.206 -9.61193 44.62796
                  danni9 | 21.47281 13.60663 1.58 0.115 -5.210387 48.156
                  danni10 | 8.387162 13.44896 0.62 0.533 -17.98684 34.76117
                  danni11 | -.3265862 13.54149 -0.02 0.981 -26.88204 26.22887
                  danni12 | -5.926994 13.38611 -0.44 0.658 -32.17775 20.32376
                  danni13 | 0 (omitted)
                  dmesi1 | 10.54829 8.512255 1.24 0.215 -6.144611 27.2412
                  dmesi2 | -6.29114 8.223336 -0.77 0.444 -22.41746 9.835182
                  dmesi3 | 10.62027 8.292123 1.28 0.200 -5.640943 26.88149
                  dmesi4 | -2.003622 8.457868 -0.24 0.813 -18.58987 14.58263
                  dmesi5 | -5.771782 8.453353 -0.68 0.495 -22.34918 10.80561
                  dmesi6 | -9.438484 8.540515 -1.11 0.269 -26.18681 7.309839
                  dmesi7 | -3.596115 8.519784 -0.42 0.673 -20.30379 13.11156
                  dmesi8 | -14.13892 8.362565 -1.69 0.091 -30.53828 2.260435
                  dmesi9 | 0 (omitted)
                  dmesi10 | -5.762943 8.439636 -0.68 0.495 -22.31344 10.78755
                  dmesi11 | -9.224132 8.542679 -1.08 0.280 -25.9767 7.528436
                  dmesi12 | -12.1577 8.496434 -1.43 0.153 -28.81958 4.504178
                  Cap | 4.30e-12 1.55e-11 0.28 0.782 -2.61e-11 3.47e-11
                  Capsq | -1.74e-24 8.27e-24 -0.21 0.834 -1.79e-23 1.45e-23
                  ForList | .2291861 .1490587 1.54 0.124 -.0631246 .5214968
                  DomList | -.0044051 .0025849 -1.70 0.088 -.0094741 .0006639
                  number_ETFs | 1.352742 .4235643 3.19 0.001 .5221133 2.18337
                  ETFsq | -.0217042 .005277 -4.11 0.000 -.0320527 -.0113556
                  number_DRs | .3473208 .1060765 3.27 0.001 .1393002 .5553414
                  returns | 234.7997 30.95248 7.59 0.000 174.1006 295.4989
                  volatility | -365.8186 160.6097 -2.28 0.023 -680.7812 -50.85605
                  returns_cac40 | -52.65409 70.19708 -0.75 0.453 -190.3136 85.00546
                  returns_ftse | 180.2156 99.22442 1.82 0.069 -14.36782 374.7991
                  returns_dj | -68.03225 88.4912 -0.77 0.442 -241.5674 105.5029
                  VIX | -.0832553 .4268673 -0.20 0.845 -.9203608 .7538501
                  returns_MSCI_EM | 173.6945 55.08124 3.15 0.002 65.67779 281.7112
                  returns_MSCIFrontier | 30.19763 58.33422 0.52 0.605 -84.19833 144.5936
                  correlation_dj | 4.536252 8.351046 0.54 0.587 -11.84052 20.91302
                  correlation_cac40 | -12.21204 9.574764 -1.28 0.202 -30.98858 6.56449
                  correlation_ftse | -1.330383 9.528218 -0.14 0.889 -20.01564 17.35487
                  _cons | -22.71233 17.81487 -1.27 0.202 -57.64808 12.22341
                  --------------------------------------------------------------------------------------

                  .
                  . estimates store pooled

                  .
                  .
                  . xtreg orderimb ///
                  > debt_GDP save_GDP export_GDP GDPg real_int sd_erate* ///
                  > danni* dmesi* ///
                  > Cap Capsq ForList DomList number_ETFs ETFsq number_DRs ///
                  > returns volatility ///
                  > returns_cac40 returns_ftse ///
                  > returns_dj VIX ///
                  > returns_MSCI_EM returns_MSCIFrontier ///
                  > correlation_dj correlation_cac40 correlation_ftse ///
                  > , re
                  note: danni13 omitted because of collinearity
                  note: dmesi12 omitted because of collinearity

                  Random-effects GLS regression Number of obs = 2,248
                  Group variable: id Number of groups = 20

                  R-sq: Obs per group:
                  within = 0.1261 min = 39
                  between = 0.6157 avg = 112.4
                  overall = 0.1425 max = 146

                  Wald chi2(47) = .
                  corr(u_i, X) = 0 (assumed) Prob > chi2 = .

                  --------------------------------------------------------------------------------------
                  orderimbalance_usd | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                  ---------------------+----------------------------------------------------------------
                  debt_GDP | .222624 .0642685 3.46 0.001 .09666 .348588
                  save_GDP | .5229846 .319304 1.64 0.101 -.1028397 1.148809
                  export_GDP | -.088665 .1071196 -0.83 0.408 -.2986156 .1212856
                  GDPgrowth | 30.07946 31.8514 0.94 0.345 -32.34813 92.50706
                  real_interest | -376.5329 231.9006 -1.62 0.104 -831.0497 77.98392
                  sd_erate_eur_local | .0544178 .5065307 0.11 0.914 -.9383642 1.0472
                  sd_erate_gbp_local | -.0504349 .4447534 -0.11 0.910 -.9221356 .8212657
                  sd_erate_usd_local | .1738648 .6477234 0.27 0.788 -1.09565 1.443379
                  danni1 | 30.80424 15.51111 1.99 0.047 .4030198 61.20547
                  danni2 | 14.99537 14.80921 1.01 0.311 -14.03014 44.02088
                  danni3 | 24.6064 15.92751 1.54 0.122 -6.610943 55.82374
                  danni4 | 14.27155 15.96148 0.89 0.371 -17.01238 45.55547
                  danni5 | 22.59426 14.50741 1.56 0.119 -5.839743 51.02825
                  danni6 | .1094486 14.39828 0.01 0.994 -28.11067 28.32956
                  danni7 | 21.02187 13.86401 1.52 0.129 -6.15109 48.19483
                  danni8 | 17.50801 13.82934 1.27 0.206 -9.596996 44.61302
                  danni9 | 21.47281 13.60663 1.58 0.115 -5.195694 48.14131
                  danni10 | 8.387162 13.44896 0.62 0.533 -17.97232 34.74664
                  danni11 | -.3265862 13.54149 -0.02 0.981 -26.86742 26.21425
                  danni12 | -5.926994 13.38611 -0.44 0.658 -32.16329 20.30931
                  danni13 | 0 (omitted)
                  dmesi1 | 22.706 8.636455 2.63 0.009 5.778855 39.63314
                  dmesi2 | 5.866563 8.131505 0.72 0.471 -10.07089 21.80402
                  dmesi3 | 22.77798 8.495018 2.68 0.007 6.128048 39.42791
                  dmesi4 | 10.15408 8.431972 1.20 0.228 -6.37228 26.68044
                  dmesi5 | 6.38592 8.373474 0.76 0.446 -10.02579 22.79763
                  dmesi6 | 2.719218 8.596298 0.32 0.752 -14.12922 19.56765
                  dmesi7 | 8.561588 8.308598 1.03 0.303 -7.722965 24.84614
                  dmesi8 | -1.981219 8.309507 -0.24 0.812 -18.26755 14.30512
                  dmesi9 | 12.1577 8.496434 1.43 0.152 -4.495003 28.81041
                  dmesi10 | 6.39476 8.417602 0.76 0.447 -10.10344 22.89296
                  dmesi11 | 2.933571 8.607229 0.34 0.733 -13.93629 19.80343
                  dmesi12 | 0 (omitted)
                  Cap | 4.30e-12 1.55e-11 0.28 0.782 -2.61e-11 3.47e-11
                  Capsq | -1.74e-24 8.27e-24 -0.21 0.834 -1.79e-23 1.45e-23
                  ForList | .2291861 .1490587 1.54 0.124 -.0629636 .5213358
                  DomList | -.0044051 .0025849 -1.70 0.088 -.0094714 .0006611
                  number_ETFs | 1.352742 .4235643 3.19 0.001 .5225707 2.182912
                  ETFsq | -.0217042 .005277 -4.11 0.000 -.032047 -.0113613
                  number_DRs | .3473208 .1060765 3.27 0.001 .1394147 .5552269
                  returns | 234.7997 30.95248 7.59 0.000 174.134 295.4655
                  volatility | -365.8186 160.6097 -2.28 0.023 -680.6078 -51.02948
                  returns_cac40 | -52.65409 70.19708 -0.75 0.453 -190.2378 84.92966
                  returns_ftse | 180.2156 99.22442 1.82 0.069 -14.26067 374.6919
                  returns_dj | -68.03225 88.4912 -0.77 0.442 -241.4718 105.4073
                  VIX | -.0832553 .4268673 -0.20 0.845 -.9198999 .7533892
                  returns_MSCI_EM | 173.6945 55.08124 3.15 0.002 65.73727 281.6518
                  returns_MSCIFrontier | 30.19763 58.33422 0.52 0.605 -84.13533 144.5306
                  correlation_dj | 4.536252 8.351046 0.54 0.587 -11.8315 20.904
                  correlation_cac40 | -12.21204 9.574764 -1.28 0.202 -30.97824 6.55415
                  correlation_ftse | -1.330383 9.528218 -0.14 0.889 -20.00535 17.34458
                  _cons | -34.87004 17.26604 -2.02 0.043 -68.71085 -1.029223
                  ---------------------+----------------------------------------------------------------
                  sigma_u | 0
                  sigma_e | 77.481641
                  rho | 0 (fraction of variance due to u_i)
                  --------------------------------------------------------------------------------------

                  . estimates store RE

                  .
                  . restore

                  Carlo: what you're suggesting is that in this case RE is simply reducing to a pooled OLS estimator, therefore there's not anything wrong with that? I understood it was because of Stata somewhat artificially setting sigma_u = 0, while in fact it might be estimated otherwise.

                  Thanks for your help!

                  Comment


                  • #10
                    Stefano:
                    some comments about your query:
                    1) please use CODe delimiters to post your Stata outputs (otherwise your results are hardly readable);
                    2) a pooled OLS needs clustered standard errors (otherwise you pretend you have independent observations whereas it is not the case due to the panel structure of your data). This won't affect coefficients;
                    3) I'm not clear why you created categorical variables by hand (-danni-[year dummies]; -dmesi-[month dummies]; by the way: why including both of them? how did you -xtset- your data?) instead of relying on the wonderful capabilities of -fvvarlist-. By the way, I'm also not sure that your data are in -lomg-format;
                    4) you seemingly have 2,248 observations and 20 groups; hence your time variable should be about 2,248/20=112,4 (months?). If that were the case you would deal with a T>N panel dataset; hence, you should switch to -xtgls- (in such a long T panel dataset, autocorrelation surely needs attention).
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Thanks Carlo, let me respond to you:

                      1) Sorry for this, will keep that in mind;

                      2) Thanks for suggesting; as it does not affect the coefficient, I did not put the clustering in the code I reported; in my analyses I am surely clustering the standard errors!

                      3) My time variable is monthly as you noted. The monthly dummies you see are January, February etc... that is, they would be equal to 1 for Jan 2006, Jan 2007 etc. I am introducing these variables to capture "monthly regularities", that is to strip out whether the dependent variable regularly behaves in a similar way on depending in the month. As I am studying stock market trading, this might be the case if most markets I am studying have concomitant fiscal-year ends; I am using dummies as I am exporting using esttab, and would like to indicate yes/no in the table without reporting coefficients. Using i.variable on categorical variables creates problems with the subcommand indicate in esttab: any way around it?

                      4) Interesting. Thanks so much for this. I thought that clustering would be enough, and wasn't aware of this command: let me go and try that out!

                      Going back to the original question, in a nutshell, should I consider the RE model collapsed on a pooled as valid?

                      Comment


                      • #12
                        Stefano:
                        3) if you plug in monthly and yearly dummies by hand, you should omit one of them to avoid the so called dummy trap; Stata does it by default omitting one dummy for month and for year due to collibneraity. This way, however, you have no control on which dummy to omit. Best off if you rely on the wonderfful capabilities of -fvvarlist-. That said, from a more substantive side, I would test whether you monthly and yearly dummies are jointly significant (see -testparm-).

                        Going back to the original question: pooled OLS (reminder: with clustered standard errors) is consistent in the RE model (but not in the FE one), as RE requires that both the components of the error terms are uncorrelated with the vector of the regressors (and this is the same prerequisite of OLS, event though focused on idiosincratic error only in this case). However, if RE were the way to go, I would not consider switching to pooled OLS.
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Originally posted by Jeff Wooldridge View Post
                          If you have some variables that change over time, and RE and POLS are identical, I suspect it is because there is negative serial correlation in the residuals. For example, maybe the dependent and/or independent variables are differences. In any case, when a negative variance is estimated for the unobserved effect, Stata sets it to zero. Which means RE becomes pooled OLS.

                          But like Clyde said, seeing the Stata output would help a lot.
                          Hi Jeff, I am facing this problem in my analysis (negative serial correlation, causing OLS = RE). I read that this problem can be a consequence of relevant variable omission, but if I ignore this my analysis will be prejudiced?

                          ps: Through the tests, the model chosen was random effect model

                          Thanks!

                          Comment


                          • #14
                            Hi everyone,

                            I am kind of dealing with same problem and could not solve it. I am working on panel data analysis. However, OLS and random effects coefficients are the same. I know there is a problem but do not know what and how to solve it.

                            Here are my results for OLS, LSDV (OLS with dummies), fixed effects model, and random effects model;


                            1-) Linear regression
                            AERY Coef. St.Err. t-value p-value [95% Conf Interval] Sig
                            MktRF 1.001 .008 122.40 0 .985 1.018 ***
                            SMB .419 .017 24.46 0 .385 .454 ***
                            HML .047 .017 2.81 .007 .014 .08 ***
                            RMW .017 .025 0.68 .499 -.033 .066
                            CMA .004 .02 0.19 .85 -.037 .044
                            Mom .013 .007 1.86 .068 -.001 .027 *
                            Constant -.195 .182 -1.07 .289 -.559 .169
                            Mean dependent var 12.480 SD dependent var 21.188
                            R-squared 0.998 Number of obs 66.000
                            F-test 5416.369 Prob > F 0.000
                            Akaike crit. (AIC) 186.676 Bayesian crit. (BIC) 202.004
                            *** p<.01, ** p<.05, * p<.1

                            2-) Linear regression (linear square dummy variable) LSDV
                            AERY Coef. St.Err. t-value p-value [95% Conf Interval] Sig
                            MktRF 1.004 .008 119.35 0 .987 1.021 ***
                            SMB .411 .019 21.80 0 .374 .449 ***
                            HML .055 .019 2.85 .006 .016 .093 ***
                            RMW .014 .026 0.55 .586 -.038 .067
                            CMA .003 .021 0.14 .889 -.039 .045
                            Mom .013 .008 1.79 .079 -.002 .028 *
                            D2 -.525 .394 -1.33 .188 -1.315 .264
                            D3 .374 .411 0.91 .368 -.451 1.198
                            D4 .357 .417 0.86 .395 -.478 1.192
                            D5 .352 .426 0.83 .412 -.501 1.206
                            D6 -.261 .436 -0.60 .553 -1.135 .614
                            Constant -.246 .325 -0.76 .453 -.896 .405
                            Mean dependent var 12.480 SD dependent var 21.188
                            R-squared 0.998 Number of obs 66.000
                            F-test 3139.426 Prob > F 0.000
                            Akaike crit. (AIC) 186.839 Bayesian crit. (BIC) 213.115
                            *** p<.01, ** p<.05, * p<.1



                            3-) Regression results (xtreg, ………………..., fe) Fixed effects Model
                            AERY Coef. St.Err. t-value p-value [95% Conf Interval] Sig
                            MktRF 1.004 .008 119.35 0 .987 1.021 ***
                            SMB .411 .019 21.80 0 .374 .449 ***
                            HML .055 .019 2.85 .006 .016 .093 ***
                            RMW .014 .026 0.55 .586 -.038 .067
                            CMA .003 .021 0.14 .889 -.039 .045
                            Mom .013 .008 1.79 .079 -.002 .028 *
                            Constant -.196 .179 -1.10 .278 -.555 .163
                            Mean dependent var 12.480 SD dependent var 21.188
                            R-squared 0.998 Number of obs 66.000
                            F-test 5720.938 Prob > F 0.000
                            Akaike crit. (AIC) 176.839 Bayesian crit. (BIC) 192.166
                            *** p<.01, ** p<.05, * p<.1
                            4-) Regression results (xtreg, ………………..., re) Random effects Model
                            AERY Coef. St.Err. t-value p-value [95% Conf Interval] Sig
                            MktRF 1.001 .008 122.40 0 .985 1.018 ***
                            SMB .419 .017 24.46 0 .386 .453 ***
                            HML .047 .017 2.81 .005 .014 .08 ***
                            RMW .017 .025 0.68 .496 -.032 .065
                            CMA .004 .02 0.19 .849 -.036 .043
                            Mom .013 .007 1.86 .063 -.001 .026 *
                            Constant -.195 .182 -1.07 .284 -.551 .162
                            Mean dependent var 12.480 SD dependent var 21.188
                            Overall r-squared 0.998 Number of obs 66.000
                            Chi-square 32498.212 Prob > chi2 0.000
                            R-squared within 0.998 R-squared between 0.971
                            *** p<.01, ** p<.05, * p<.1

                            Comment


                            • #15
                              Karaca:
                              are you sure that you have a panel-wise effect?
                              What does -xttest0- after -xtreg,re- give you back?
                              That said, please do not urge privately potentially interested listers to reply to your queries : we're all busy persons (like you) and, from time to time, may well have dynamic priorities settings that rank replying to Stata queries in the middle instead of at the top of the list. Thanks.
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment

                              Working...
                              X