Announcement

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

  • Pooled OLS, Random Effects and Fixed Effects all giving exact same results!

    Hi there,

    I am using a panel data set to investigate the link between inequality and growth.

    But I am getting the exact same results for fixed effects, random effects and pooled OLS and have no idea why?! Seems very strange to me.

    I have attached photos to show my regression results (for some reason stata was not letting me use ssc install dataex to download example!)

    Sigm_u is coming up as zero for random effects (not shown in images). I understand this means there is a negative bias which makes pooled OLS and random effects the same but I would not expect this to make the fixed effects results the same?

    Any pointers would be greatly appreciated!
    Attached Files

  • #2
    Louis:
    if you have Stata 15, -dataex- comes with it; if you're using an older Stata release, as per FAQ you should tell the list.
    That said, what does -hausman- test outcome look like?
    Last edited by Carlo Lazzaro; 06 Apr 2019, 08:26.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo,

      Thanks for your response. I am using stata 15.1.

      I have run a Hausman test - results are attached.

      Are there any conditions for RE FE and POLS all to give the exact same coefficient estimates?

      Click image for larger version

Name:	Screen Shot 2019-04-06 at 16.37.54.png
Views:	2
Size:	43.4 KB
ID:	1492135
      Attached Files

      Comment


      • #4
        Louis:
        while is not surprising that OLS with i.panelid gives identical to -xtreg,fe-, a R-sq between in -re- is actually strange.
        You may want to test with the user-written command -xtoverid- if the -re- specification fits your data.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          To add to Carlo's helpful comments, there is something very strange about fe and re giving identical results. It is even stranger since the fe estimate indicates the fixed effects are highly correlated with the regressors, and re imposes the assumption they are not. In addition, the fe indicates the panel effects do matter.

          In short, this is not a standard issue of fe-vs-re-vs-pooled choice. There is something screwy with the estimates, and what it is is not clear. As Carlo suggests, it may be worth trying to understand the r-square of 1 for between in the re estimates.

          Comment


          • #6
            Thanks for the responses!

            When inputting xtoverid into stata I receive the response:

            Error - must have ivreg2/ivreg29/ivreg28 version 2.1.15 or greater installed.

            Not sure how to amend this?

            As this is for my dissertation, the only way I have been able to move forward and present my results in a way I can explain them is by dropping the dummy variable i.countryid. This makes the results all differ in a way I can explain - pooled OLS, fe and re now all yield different results.

            Any idea why dropping the country dummy variable causes this?

            Comment


            • #7
              Louis:
              just install, say, the community-contributed command -ivreg2- (type withinStata -search ivreg2- and install it) before using -xtoverid- and try again.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thanks Carlo!

                I have tried to input the xtoverid command after installing ivreg2 but now I am getting this response:

                "xtoverid not compatible with xtreg model fe"

                Any idea why?

                Comment


                • #9
                  Louis:
                  the error message is right, in that -xtoverid-, unlike -hausman- can only test whether the -re- specification is right for your data.
                  Hence, you shoud run -xtreg,re- and then invoke -xtoverid-: if the test outcome does not reach statistical significance, go -re-; otherwise, switch to -fe-.
                  Kind regards,
                  Carlo
                  (Stata 19.0)

                  Comment


                  • #10
                    I have tried this and got the response:

                    Error - saved RE estimates are degenerate (sigma_u=0) and equivalent to pooled OLS

                    How can I interpret this? As the fixed effects results are also identical to POLS does this mean all the results are problematic? Im struggling to see a reason why they are all coming out the same!

                    Comment


                    • #11
                      This can happen if you do not have any between variation in your data, which is my guess at what is happening here.

                      Code:
                      webuse grunfeld, clear
                      keep if company==1
                      expand 2
                      replace company=2 if inrange(_n, 21, 40)
                      xtreg invest mvalue kstock, fe
                      xtreg invest mvalue kstock, re
                      regress invest mvalue kstock
                      Result:

                      Code:
                      . xtreg invest mvalue kstock, fe
                      
                      Fixed-effects (within) regression               Number of obs     =         40
                      Group variable: company                         Number of groups  =          2
                      
                      R-sq:                                           Obs per group:
                           within  = 0.9214                                         min =         20
                           between =      .                                         avg =       20.0
                           overall = 0.9214                                         max =         20
                      
                                                                      F(2,36)           =     210.87
                      corr(u_i, Xb)  =      .                         Prob > F          =     0.0000
                      
                      ------------------------------------------------------------------------------
                            invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                            mvalue |   .1192808   .0177528     6.72   0.000     .0832764    .1552852
                            kstock |   .3714448   .0254759    14.58   0.000     .3197774    .4231122
                             _cons |  -149.7824   72.73303    -2.06   0.047    -297.2918   -2.272972
                      -------------+----------------------------------------------------------------
                           sigma_u |          0
                           sigma_e |  89.195743
                               rho |          0   (fraction of variance due to u_i)
                      ------------------------------------------------------------------------------
                      F test that all u_i=0: F(1, 36) = 0.00                       Prob > F = 1.0000
                      
                      . xtreg invest mvalue kstock, re
                      
                      Random-effects GLS regression                   Number of obs     =         40
                      Group variable: company                         Number of groups  =          2
                      
                      R-sq:                                           Obs per group:
                           within  = 0.0000                                         min =         20
                           between = 0.0000                                         avg =       20.0
                           overall = 0.9214                                         max =         20
                      
                                                                      Wald chi2(2)      =     433.46
                      corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                      
                      ------------------------------------------------------------------------------
                            invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                            mvalue |   .1192808   .0175113     6.81   0.000     .0849593    .1536023
                            kstock |   .3714448   .0251292    14.78   0.000     .3221924    .4206972
                             _cons |  -149.7824   71.74342    -2.09   0.037    -290.3969   -9.167877
                      -------------+----------------------------------------------------------------
                           sigma_u |          0
                           sigma_e |  89.195743
                               rho |          0   (fraction of variance due to u_i)
                      ------------------------------------------------------------------------------
                      
                      . regress invest mvalue kstock
                      
                            Source |       SS           df       MS      Number of obs   =        40
                      -------------+----------------------------------   F(2, 37)        =    216.73
                             Model |   3355373.3         2  1677686.65   Prob > F        =    0.0000
                          Residual |    286411.7        37  7740.85675   R-squared       =    0.9214
                      -------------+----------------------------------   Adj R-squared   =    0.9171
                             Total |     3641785        39  93379.1027   Root MSE        =    87.982
                      
                      ------------------------------------------------------------------------------
                            invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                            mvalue |   .1192808   .0175113     6.81   0.000     .0837996    .1547621
                            kstock |   .3714448   .0251292    14.78   0.000     .3205281    .4223615
                             _cons |  -149.7824   71.74342    -2.09   0.044    -295.1484   -4.416419
                      ------------------------------------------------------------------------------
                      ADDED IN EDIT: I see from your previous posts that you have between R2=1. Same case as above except that your variables across panels are linear combinations of each other. Here is the extension based on my example.

                      Code:
                      webuse grunfeld, clear
                      keep if company==1
                      expand 2
                      replace company=2 if inrange(_n, 21, 40)
                      *VARIABLES FOR COMPANY 2 ARE (2*COMPANY 1)
                      foreach var in invest mvalue kstock{
                      replace `var'= `var'*2 if inrange(_n, 21, 40)
                      }
                      xtreg invest mvalue kstock, re
                      regress invest mvalue kstock
                      Result:

                      Code:
                      . xtreg invest mvalue kstock, re
                      
                      Random-effects GLS regression                   Number of obs     =         40
                      Group variable: company                         Number of groups  =          2
                      
                      R-sq:                                           Obs per group:
                           within  = 0.9174                                         min =         20
                           between = 1.0000                                         avg =       20.0
                           overall = 0.9391                                         max =         20
                      
                                                                      Wald chi2(2)      =     570.98
                      corr(u_i, X)   = 0 (assumed)                    Prob > chi2       =     0.0000
                      
                      ------------------------------------------------------------------------------
                            invest |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                            mvalue |   .0930732   .0102064     9.12   0.000     .0730689    .1130775
                            kstock |   .3805043   .0256835    14.82   0.000     .3301656     .430843
                             _cons |  -63.11561   62.71374    -1.01   0.314    -186.0323    59.80105
                      -------------+----------------------------------------------------------------
                           sigma_u |          0
                           sigma_e |  141.03085
                               rho |          0   (fraction of variance due to u_i)
                      ------------------------------------------------------------------------------
                      
                      . 
                      . regress invest mvalue kstock
                      
                            Source |       SS           df       MS      Number of obs   =        40
                      -------------+----------------------------------   F(2, 37)        =    285.49
                             Model |  12022292.4         2  6011146.22   Prob > F        =    0.0000
                          Residual |  779053.301        37  21055.4946   R-squared       =    0.9391
                      -------------+----------------------------------   Adj R-squared   =    0.9359
                             Total |  12801345.7        39  328239.635   Root MSE        =    145.11
                      
                      ------------------------------------------------------------------------------
                            invest |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
                      -------------+----------------------------------------------------------------
                            mvalue |   .0930732   .0102064     9.12   0.000      .072393    .1137534
                            kstock |   .3805043   .0256835    14.82   0.000     .3284647    .4325439
                             _cons |  -63.11561   62.71374    -1.01   0.321    -190.1857    63.95449
                      ------------------------------------------------------------------------------
                      Last edited by Andrew Musau; 10 Apr 2019, 13:40.

                      Comment


                      • #12
                        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 (OLS)

                        . asdoc regress AERY MktRF SMB HML RMW CMA Mom, replace


                        Source | SS df MS Number of obs = 66
                        -------------+---------------------------------- F(6, 59) = 5416.37
                        Model | 29128.9313 6 4854.82188 Prob > F = 0.0000
                        Residual | 52.8831237 59 .89632413 R-squared = 0.9982
                        -------------+---------------------------------- Adj R-squared = 0.9980
                        Total | 29181.8144 65 448.950991 Root MSE = .94674

                        ------------------------------------------------------------------------------
                        AERY | Coef. Std. Err. t P>|t| [95% Conf. Interval]
                        -------------+----------------------------------------------------------------
                        MktRF | 1.001499 .0081823 122.40 0.000 .9851261 1.017872
                        SMB | .4192452 .0171385 24.46 0.000 .3849511 .4535394
                        HML | .0470112 .016713 2.81 0.007 .0135686 .0804539
                        RMW | .0168759 .0247946 0.68 0.499 -.0327379 .0664897
                        CMA | .0038372 .0201636 0.19 0.850 -.0365101 .0441845
                        Mom | .0128932 .006925 1.86 0.068 -.0009637 .0267501
                        _cons | -.1946927 .1818611 -1.07 0.289 -.5585959 .1692106
                        ------------------------------------------------------------------------------


                        2-) OLS with dummies (LSDV)

                        . asdoc regress AERY MktRF SMB HML RMW CMA Mom D2 D3 D4 D5 D6, replace

                        Source | SS df MS Number of obs = 66
                        -------------+---------------------------------- F(11, 54) = 3139.43
                        Model | 29136.2543 11 2648.75039 Prob > F = 0.0000
                        Residual | 45.5600888 54 .843705347 R-squared = 0.9984
                        -------------+---------------------------------- Adj R-squared = 0.9981
                        Total | 29181.8144 65 448.950991 Root MSE = .91853

                        ------------------------------------------------------------------------------
                        AERY | Coef. Std. Err. t P>|t| [95% Conf. Interval]
                        -------------+----------------------------------------------------------------
                        MktRF | 1.00382 .0084108 119.35 0.000 .9869576 1.020683
                        SMB | .4114549 .0188748 21.80 0.000 .3736132 .4492967
                        HML | .0545304 .0191644 2.85 0.006 .0161082 .0929526
                        RMW | .014417 .0262901 0.55 0.586 -.0382916 .0671256
                        CMA | .0029491 .0210127 0.14 0.889 -.039179 .0450771
                        Mom | .0134288 .0075123 1.79 0.079 -.0016324 .0284901
                        D2 | -.5252351 .3938701 -1.33 0.188 -1.314897 .264427
                        D3 | .3736749 .4112653 0.91 0.368 -.4508623 1.198212
                        D4 | .3567764 .4165184 0.86 0.395 -.4782927 1.191846
                        D5 | .3522308 .4256779 0.83 0.412 -.5012021 1.205664
                        D6 | -.2605524 .4363413 -0.60 0.553 -1.135364 .6142594
                        _cons | -.2455959 .3246247 -0.76 0.453 -.8964293 .4052375
                        ------------------------------------------------------------------------------



                        3-) Fixed Effects Model

                        . asdoc xtreg AERY MktRF SMB HML RMW CMA Mom, fe, replace

                        Fixed-effects (within) regression Number of obs = 66
                        Group variable: Reg Number of groups = 6

                        R-sq: Obs per group:
                        within = 0.9984 min = 11
                        between = 0.9675 avg = 11.0
                        overall = 0.9982 max = 11

                        F(6,54) = 5720.94
                        corr(u_i, Xb) = -0.0450 Prob > F = 0.0000

                        ------------------------------------------------------------------------------
                        AERY | Coef. Std. Err. t P>|t| [95% Conf. Interval]
                        -------------+----------------------------------------------------------------
                        MktRF | 1.00382 .0084108 119.35 0.000 .9869576 1.020683
                        SMB | .4114549 .0188748 21.80 0.000 .3736132 .4492967
                        HML | .0545304 .0191644 2.85 0.006 .0161082 .0929526
                        RMW | .014417 .0262901 0.55 0.586 -.0382916 .0671256
                        CMA | .0029491 .0210127 0.14 0.889 -.039179 .0450771
                        Mom | .0134288 .0075123 1.79 0.079 -.0016324 .0284901
                        _cons | -.1961135 .1790362 -1.10 0.278 -.5550595 .1628325
                        -------------+----------------------------------------------------------------
                        sigma_u | .37948838
                        sigma_e | .91853435
                        rho | .14580235 (fraction of variance due to u_i)
                        ------------------------------------------------------------------------------
                        F test that all u_i=0: F(5, 54) = 1.74 Prob > F = 0.1421



                        4-) Random Effects Model

                        . asdoc xtreg AERY MktRF SMB HML RMW CMA Mom, re, replace

                        Random-effects GLS regression Number of obs = 66
                        Group variable: Reg Number of groups = 6

                        R-sq: Obs per group:
                        within = 0.9984 min = 11
                        between = 0.9709 avg = 11.0
                        overall = 0.9982 max = 11

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

                        ------------------------------------------------------------------------------
                        AERY | Coef. Std. Err. z P>|z| [95% Conf. Interval]
                        -------------+----------------------------------------------------------------
                        MktRF | 1.001499 .0081823 122.40 0.000 .9854618 1.017536
                        SMB | .4192452 .0171385 24.46 0.000 .3856543 .4528361
                        HML | .0470112 .016713 2.81 0.005 .0142544 .0797681
                        RMW | .0168759 .0247946 0.68 0.496 -.0317205 .0654723
                        CMA | .0038372 .0201636 0.19 0.849 -.0356827 .0433572
                        Mom | .0128932 .006925 1.86 0.063 -.0006795 .0264659
                        _cons | -.1946927 .1818611 -1.07 0.284 -.5511339 .1617486
                        -------------+----------------------------------------------------------------
                        sigma_u | 0
                        sigma_e | .91853435
                        rho | 0 (fraction of variance due to u_i)
                        ------------------------------------------------------------------------------

                        Thank you



                        Comment


                        • #13
                          Numbers are don't look okay. here is the word version


                          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


                          • #14
                            Hello. I was getting the exact same error. My mistake was that I was using
                            Code:
                             xtset Time_variable Panel_variable
                            instead of
                            Code:
                             xtset Panel_variable Time_variable
                            .

                            Comment

                            Working...
                            X