Announcement

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

  • Hausman test

    Hi,

    For my thesis I am doing a panel data analyses, and I am trying to perform an Haussmen test to determine random or fixed effects model.
    However, with the outcome of the haussman test I get the following output.
    How can I best solve this problem? (I already tried the sigmamore test, but this still does not work)

    hausman fe re, sigmamore

    Note: the rank of the differenced variance matrix (0) does not equal the number of coefficients
    being tested (4); be sure this is what you expect, or there may be problems computing the
    test. Examine the output of your estimators for anything unexpected and possibly consider
    scaling your variables so that the coefficients are on a similar scale.

    ---- Coefficients ----
    | (b) (B) (b-B) sqrt(diag(V_b-V_B))
    | fe re Difference Std. err.
    -------------+----------------------------------------------------------------
    sacd | .0009592 .0009592 0 0
    meanvaluee~c | 915.4605 915.4605 0 0
    industrydu~y | -9.789869 -9.789869 0 0
    firmsizeco~l | -3.293249 -3.293249 0 0
    ------------------------------------------------------------------------------
    b = Consistent under H0 and Ha; obtained from xtreg.
    B = Inconsistent under Ha, efficient under H0; obtained from xtreg.

    Thankyou!


  • #2
    Either there is an issue with your data or you stored estimates from the same model twice. Can you show the full set of commands that you ran and the exact Stata output? Place these within CODE delimiters

    Code:
    as I do here

    Comment


    • #3
      Hi Andrew,

      Thankyou for your reply.
      Hopefully I used the Code delimiters correctly. :
      Code:
      xtreg salesgrowth1year sacd meanvalueenvironmentalmunificenc meanvaluedynamism firmsizecontrol ind
      > ustrydummy, fe
      note: meanvalueenvironmentalmunificenc omitted because of collinearity.
      note: meanvaluedynamism omitted because of collinearity.
      note: industrydummy omitted because of collinearity.
      
      Fixed-effects (within) regression               Number of obs     =        254
      Group variable: gvkey                           Number of groups  =        117
      
      R-squared:                                      Obs per group:
           Within  = 0.0001                                         min =          1
           Between = 0.0038                                         avg =        2.2
           Overall = 0.0141                                         max =          6
      
                                                      F(2,135)          =       0.00
      corr(u_i, Xb) = 0.1174                          Prob > F          =     0.9963
      
      --------------------------------------------------------------------------------------------------
                      salesgrowth1year | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
      ---------------------------------+----------------------------------------------------------------
                                  sacd |  -1.37e-06   .0000264    -0.05   0.959    -.0000535    .0000508
      meanvalueenvironmentalmunificenc |          0  (omitted)
                     meanvaluedynamism |          0  (omitted)
                       firmsizecontrol |  -.0243331   .4024349    -0.06   0.952    -.8202255    .7715592
                         industrydummy |          0  (omitted)
                                 _cons |   .4410763   2.960823     0.15   0.882    -5.414521    6.296674
      ---------------------------------+----------------------------------------------------------------
                               sigma_u |   .7035624
                               sigma_e |  1.5188745
                                   rho |  .17666081   (fraction of variance due to u_i)
      --------------------------------------------------------------------------------------------------
      F test that all u_i=0: F(116, 135) = 0.71                    Prob > F = 0.9689
      
      . xtreg salesgrowth1year sacd meanvalueenvironmentalmunificenc meanvaluedynamism firmsizecontrol    
      >   industrydummy, re
      note: meanvaluedynamism omitted because of collinearity.
      
      Random-effects GLS regression                   Number of obs     =        254
      Group variable: gvkey                           Number of groups  =        117
      
      R-squared:                                      Obs per group:
           Within  = 0.0000                                         min =          1
           Between = 0.0739                                         avg =        2.2
           Overall = 0.0570                                         max =          6
      
                                                      Wald chi2(4)      =      15.06
      corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0046
      
      --------------------------------------------------------------------------------------------------
                      salesgrowth1year | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
      ---------------------------------+----------------------------------------------------------------
                                  sacd |   2.08e-08   .0000189     0.00   0.999     -.000037     .000037
      meanvalueenvironmentalmunificenc |   19.73189   11.16671     1.77   0.077    -2.154466    41.61825
                     meanvaluedynamism |          0  (omitted)
                       firmsizecontrol |  -.0184656   .0373252    -0.49   0.621    -.0916216    .0546904
                         industrydummy |   -.137256    .125126    -1.10   0.273    -.3824984    .1079865
                                 _cons |   1.032992   .7884602     1.31   0.190    -.5123619    2.578345
      ---------------------------------+----------------------------------------------------------------
                               sigma_u |          0
                               sigma_e |  1.5188745
                                   rho |          0   (fraction of variance due to u_i)
      --------------------------------------------------------------------------------------------------  estimate store re
      
      . estimate store fe
      
      . hausman fe re
      
      Note: the rank of the differenced variance matrix (0) does not equal the number of coefficients
              being tested (4); be sure this is what you expect, or there may be problems computing the
              test.  Examine the output of your estimators for anything unexpected and possibly consider
              scaling your variables so that the coefficients are on a similar scale.
      
                       ---- Coefficients ----
                   |      (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
                   |       fe           re         Difference       Std. err.
      -------------+----------------------------------------------------------------
              sacd |    2.08e-08     2.08e-08               0               0
      meanvaluee~c |    19.73189     19.73189               0               0
      firmsizeco~l |   -.0184656    -.0184656               0               0
      industrydu~y |    -.137256     -.137256               0               0
      ------------------------------------------------------------------------------
                                b = Consistent under H0 and Ha; obtained from xtreg.
                 B = Inconsistent under Ha, efficient under H0; obtained from xtreg.
      
      Test of H0: Difference in coefficients not systematic
      
          chi2(0) = (b-B)'[(V_b-V_B)^(-1)](b-B)
                  = 0.00
      Prob > chi2 =    .
      (V_b-V_B is not positive definite)

      Comment


      • #4
        Originally posted by Eline Meijer View Post
        Hopefully I used the Code delimiters correctly. :
        Yes, thank you. You did store the same model twice. You need

        Code:
        xtreg salesgrowth1year sacd meanvalueenvironmentalmunificenc meanvaluedynamism firmsizecontrol industrydummy, fe
        est sto fe
        xtreg salesgrowth1year sacd meanvalueenvironmentalmunificenc meanvaluedynamism firmsizecontrol industrydummy, re
        est sto re
        hausman fe re
        Some Notes:

        1. Rescale the sacd variable. Its coefficients are too small.

        Code:
        *Express the variable in millions
        replace sacd= sacd/1e+6
        2. If you have 30+ firms, you should calculate cluster robust standard errors to take care of heteroscedasticity and arbitrary forms of serial correlation
        3. If you do so, look at the community contributed command xtoverid from SSC to help you choose between FE and RE

        Code:
        ssc install xtoverid, replace
        help xtoverid
        Last edited by Andrew Musau; 13 Dec 2022, 14:43.

        Comment


        • #5
          Hi Andrew,

          Thanks for your reply!
          Unfortunately, I still get the same notificitation after conducting these steps.
          In addition, do you maybe know how I can assure that variable 'environmental dynamism' is also taken into account in the analyses?

          Code:
           replace sacd= sacd/1e+6
          variable sacd was long now double
          (263 real changes made)
           ssc install xtoverid, replace
          checking xtoverid consistency and verifying not already installed...
          installing into C:\Users\Eline\ado\plus\...
          installation complete.
          
          . help xtoverid
          
          . xtreg salesgrowth3year sacd meanvaluedynamism meanvalueenvironmentalmunificenc firmsizecontrol industryd
          > ummy, fe
          note: meanvaluedynamism omitted because of collinearity.
          
          Fixed-effects (within) regression               Number of obs     =      2,652
          Group variable: sabd                            Number of groups  =         53
          
          R-squared:                                      Obs per group:
               Within  = 0.0087                                         min =          1
               Between = 0.0365                                         avg =       50.0
               Overall = 0.0076                                         max =      1,826
          
                                                          F(4,2595)         =       5.72
          corr(u_i, Xb) = -0.3950                         Prob > F          =     0.0001
          
          --------------------------------------------------------------------------------------------------
                          salesgrowth3year | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
          ---------------------------------+----------------------------------------------------------------
                                      sacd |  -13560.93    2041686    -0.01   0.995     -4017060     3989938
                         meanvaluedynamism |          0  (omitted)
          meanvalueenvironmentalmunificenc |   932.2239   410.1642     2.27   0.023     127.9418    1736.506
                           firmsizecontrol |  -3.524774   1.969087    -1.79   0.074    -7.385914    .3363665
                             industrydummy |  -10.18236   4.587859    -2.22   0.027    -19.17859   -1.186123
                                     _cons |   74.62328   47.16309     1.58   0.114    -17.85781    167.1044
          ---------------------------------+----------------------------------------------------------------
                                   sigma_u |  64.481602
                                   sigma_e |  252.86382
                                       rho |  .06105727   (fraction of variance due to u_i)
          
          
          
          .  xtreg salesgrowth3year sacd meanvaluedynamism meanvalueenvironmentalmunificenc firmsizecontrol industry
          > dummy, re
          note: meanvaluedynamism omitted because of collinearity.
          
          Random-effects GLS regression                   Number of obs     =      2,652
          Group variable: sabd                            Number of groups  =         53
          
          R-squared:                                      Obs per group:
          Within  = 0.0087                                         min =          1
          Between = 0.1521                                         avg =       50.0
          Overall = 0.0086                                         max =      1,826
          
          Wald chi2(4)      =      23.08
          corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0001
          
          
          salesgrowth3year  Coefficient  Std. err.      z    P>z     [95% conf. interval]
          
          sacd    959.2338   8060.533     0.12   0.905    -14839.12    16757.59
          meanvaluedynamism           0  (omitted)
          meanvalueenvironmentalmunificenc    915.4605    402.338     2.28   0.023     126.8925    1704.028
          firmsizecontrol   -3.293249   1.877834    -1.75   0.079    -6.973736    .3872383
          industrydummy   -9.789869   4.461124    -2.19   0.028    -18.53351   -1.046227
          _cons    71.09942   29.58207     2.40   0.016     13.11962    129.0792
          
          sigma_u           0
          sigma_e   252.86382
          rho           0   (fraction of variance due to u_i)
          
          
          . est store fe
          
          . est store re
          
          . hausman fe re
          
          Note: the rank of the differenced variance matrix (0) does not equal the number of coefficients being
          tested (4); be sure this is what you expect, or there may be problems computing the test.  Examine
          the output of your estimators for anything unexpected and possibly consider scaling your variables
          so that the coefficients are on a similar scale.
          
          Coefficients ----
          (b)          (B)            (b-B)     sqrt(diag(V_b-V_B))
          fe           re         Difference       Std. err.
          
          sacd     959.2338     959.2338               0               0
          meanvaluee~c     915.4605     915.4605               0               0
          firmsizeco~l    -3.293249    -3.293249               0               0
          industrydu~y    -9.789869    -9.789869               0               0
          
          b = Consistent under H0 and Ha; obtained from xtreg.
          B = Inconsistent under Ha, efficient under H0; obtained from xtreg.
          
          Test of H0: Difference in coefficients not systematic
          
          chi2(0) = (b-B)'[(V_b-V_B)^(-1)](b-B)
          = 0.00
          Prob > chi2 =    .
          (V_b-V_B is not positive definite)
          
          .
          Thanks a lot in advance!
          Eline

          Comment


          • #6
            Look at what I do in #4. I first run the fixed effects regression, store its estimates and then run the random effects regression and store its estimates. This is not what you do in #5. For the suggestion to cluster standard errors and use xtoverid, you need:

            Code:
            xtreg salesgrowth1year sacd meanvalueenvironmentalmunificenc meanvaluedynamism firmsizecontrol industrydummy, re robust
            xtoverid
            A significant Sargan-Hansen statistic implies that the random effects estimator is inconsistent and therefore you should choose fixed effects.

            Comment


            • #7
              This helps, thanks a lot!

              Comment


              • #8
                Originally posted by Eline Meijer View Post
                In addition, do you maybe know how I can assure that variable 'environmental dynamism' is also taken into account in the analyses?
                The output indicates that this variable is collinear with some other variable(s) in the regression. If it is a control variable, don't worry about it and proceed as its effect is already accounted for. If it is an important variable and you need to study its effect, then you need to find what other variables it is collinear with and then decide how you want to reformulate the model (e.g., including this variable and dropping the other one(s)). Start by looking at simple correlation coefficients for variables in your model.

                Code:
                correlate salesgrowth1year sacd meanvalueenvironmentalmunificenc meanvaluedynamism firmsizecontrol industrydummy

                Comment


                • #9
                  Hi Andrew,

                  Thanks for your reply.
                  I tried this, and accordingly to exclude the correlated variables, but I still get this notification.
                  Since environmental dynamism and environmental munificence are my moderating variables, I cannot exclude this variable in the analyses.
                  Code:
                  . correlate salesgrowth3year sacd meanvalueenvironmentalmunificenc meanvaluedynamism industrydummy dummyva
                  > riable firmsizecontrol
                  (obs=2,652)
                  
                               | sa~3year     sacd meanva~c meanva~m indust~y dummyv~e firmsi~l
                  -------------+---------------------------------------------------------------
                  salesg~3year |   1.0000
                          sacd |  -0.0009   1.0000
                  meanvaluee~c |   0.0782  -0.0065   1.0000
                  meanvalued~m |  -0.0328  -0.0136   0.2314   1.0000
                  industrydu~y |  -0.0683   0.0145  -0.4477   0.2871   1.0000
                  dummyvaria~e |  -0.0247   0.0387   0.0000  -0.0000   0.0000   1.0000
                  firmsizeco~l |  -0.0400   0.0629  -0.1711  -0.2774  -0.0738   0.0791   1.0000
                  
                  
                  . xtreg salesgrowth3year sacd meanvaluedynamism firmsizecontrol industrydummy dummyvariable, fe
                  note: meanvaluedynamism omitted because of collinearity.
                  
                  Fixed-effects (within) regression               Number of obs     =      2,652
                  Group variable: sabd                            Number of groups  =         53
                  
                  R-squared:                                      Obs per group:
                       Within  = 0.0074                                         min =          1
                       Between = 0.0004                                         avg =       50.0
                       Overall = 0.0042                                         max =      1,826
                  
                                                                  F(4,2595)         =       4.87
                  corr(u_i, Xb) = -0.6825                         Prob > F          =     0.0007
                  
                  -----------------------------------------------------------------------------------
                   salesgrowth3year | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  ------------------+----------------------------------------------------------------
                               sacd |   33461.99    2043313     0.02   0.987     -3973226     4040150
                  meanvaluedynamism |          0  (omitted)
                    firmsizecontrol |  -4.589953   1.916176    -2.40   0.017    -8.347341    -.832565
                      industrydummy |  -15.37596   4.065132    -3.78   0.000    -23.34719   -7.404727
                      dummyvariable |  -4.258121   3.188154    -1.34   0.182     -10.5097    1.993462
                              _cons |   129.7785   45.49229     2.85   0.004     40.57366    218.9834
                  ------------------+----------------------------------------------------------------
                            sigma_u |  138.67703
                            sigma_e |  253.02842
                                rho |  .23099378   (fraction of variance due to u_i)
                  -----------------------------------------------------------------------------------
                  F test that all u_i=0: F(52, 2595) = 0.02                    Prob > F = 1.0000
                  
                  . xtreg salesgrowth3year sacd meanvaluedynamism industrydummy dummyvariable, fe
                  note: meanvaluedynamism omitted because of collinearity.
                  
                  Fixed-effects (within) regression               Number of obs     =      2,652
                  Group variable: sabd                            Number of groups  =         53
                  
                  R-squared:                                      Obs per group:
                       Within  = 0.0053                                         min =          1
                       Between = 0.0006                                         avg =       50.0
                       Overall = 0.0011                                         max =      1,826
                  
                                                                  F(3,2596)         =       4.57
                  corr(u_i, Xb) = -0.8899                         Prob > F          =     0.0034
                  
                  -----------------------------------------------------------------------------------
                   salesgrowth3year | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  ------------------+----------------------------------------------------------------
                               sacd |    60172.8    2045146     0.03   0.977     -3950109     4070455
                  meanvaluedynamism |          0  (omitted)
                      industrydummy |  -14.27493   4.042746    -3.53   0.000    -22.20226   -6.347598
                      dummyvariable |  -4.192154   3.190943    -1.31   0.189     -10.4492    2.064896
                              _cons |   96.27985   43.32892     2.22   0.026     11.31711    181.2426
                  ------------------+----------------------------------------------------------------
                            sigma_u |  254.02055
                            sigma_e |   253.2592
                                rho |  .50150084   (fraction of variance due to u_i)
                  -----------------------------------------------------------------------------------
                  F test that all u_i=0: F(52, 2596) = 0.01                    Prob > F = 1.0000
                  
                  .  correlate salesgrowth3year sacd meanvalueenvironmentalmunificenc meanvaluedynamism dummyvariable
                  (obs=2,652)
                  
                               | sa~3year     sacd meanva~c meanva~m dummyv~e
                  -------------+---------------------------------------------
                  salesg~3year |   1.0000
                          sacd |  -0.0009   1.0000
                  meanvaluee~c |   0.0782  -0.0065   1.0000
                  meanvalued~m |  -0.0328  -0.0136   0.2314   1.0000
                  dummyvaria~e |  -0.0247   0.0387   0.0000  -0.0000   1.0000
                  
                  
                  .  xtreg salesgrowth3year sacd meanvalueenvironmentalmunificenc meanvaluedynamism dummyvariable, fe
                  note: meanvaluedynamism omitted because of collinearity.
                  
                  Fixed-effects (within) regression               Number of obs     =      2,652
                  Group variable: sabd                            Number of groups  =         53
                  
                  R-squared:                                      Obs per group:
                       Within  = 0.0067                                         min =          1
                       Between = 0.0000                                         avg =       50.0
                       Overall = 0.0030                                         max =      1,826
                  
                                                                  F(3,2596)         =       5.85
                  corr(u_i, Xb) = -0.7407                         Prob > F          =     0.0006
                  
                  --------------------------------------------------------------------------------------------------
                                  salesgrowth3year | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  ---------------------------------+----------------------------------------------------------------
                                              sacd |   38222.36    2043624     0.02   0.985     -3969076     4045520
                  meanvalueenvironmentalmunificenc |   1448.301   358.4444     4.04   0.000      745.435    2151.167
                                 meanvaluedynamism |          0  (omitted)
                                     dummyvariable |  -3.900198   3.184474    -1.22   0.221    -10.14456    2.344168
                                             _cons |   9.266159   37.63718     0.25   0.806    -64.53577    83.06809
                  ---------------------------------+----------------------------------------------------------------
                                           sigma_u |  162.15972
                                           sigma_e |  253.07213
                                               rho |  .29107155   (fraction of variance due to u_i)
                  --------------------------------------------------------------------------------------------------
                  F test that all u_i=0: F(52, 2596) = 0.01                    Prob > F = 1.0000
                  
                  .  xtreg salesgrowth3year sacd meanvaluedynamism dummyvariable, fe
                  note: meanvaluedynamism omitted because of collinearity.
                  
                  Fixed-effects (within) regression               Number of obs     =      2,652
                  Group variable: sabd                            Number of groups  =         53
                  
                  R-squared:                                      Obs per group:
                       Within  = 0.0005                                         min =          1
                       Between = 0.0017                                         avg =       50.0
                       Overall = 0.0000                                         max =      1,826
                  
                                                                  F(2,2597)         =       0.61
                  corr(u_i, Xb) = -0.9585                         Prob > F          =     0.5411
                  
                  -----------------------------------------------------------------------------------
                   salesgrowth3year | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                  ------------------+----------------------------------------------------------------
                               sacd |   36219.58    2049645     0.02   0.986     -3982884     4055324
                  meanvaluedynamism |          0  (omitted)
                      dummyvariable |  -3.538488   3.192594    -1.11   0.268    -9.798776    2.721799
                              _cons |   20.06457   37.65279     0.53   0.594    -53.76795    93.89709
                  ------------------+----------------------------------------------------------------
                            sigma_u |  153.24704
                            sigma_e |  253.81776
                                rho |  .26715003   (fraction of variance due to u_i)
                  -----------------------------------------------------------------------------------
                  F test that all u_i=0: F(52, 2597) = 0.00                    Prob > F = 1.0000

                  Comment


                  • #10
                    Eline:
                    as an aside to Andrew's excellent advice:
                    1) if your -meanvaluedynamism- is panel-specific and time-invariant, as expected the -fe- estimator will wipe it out;
                    2) your within R-sq is negligible. This result should warn you about the lack of a panel-wise effect (that is also echoed by the lack of statistical significance of the F-test on u_i);
                    3) the panel-specific number of observations is totally unbalanced, as they range from 1 to 1826. I would be really queasy about running a panel data regression on a similar dataset and probably switch to a pooled OLS. In addition, even assuming the existence of a panel-wise effect, the relevance of the T dimension would make me to switch from -xtreg,fe- to -xtregar,fe-;
                    4) I would check the correctness of the functional form of the regresssand via the following approach, that mimicks -linktest-;
                    Code:
                    . use "https://www.stata-press.com/data/r17/nlswork.dta"
                    (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
                    
                    . xtreg ln_wage c.age##c.age i.year, fe
                    
                    Fixed-effects (within) regression               Number of obs     =     28,510
                    Group variable: idcode                          Number of groups  =      4,710
                    
                    R-squared:                                      Obs per group:
                         Within  = 0.1162                                         min =          1
                         Between = 0.1078                                         avg =        6.1
                         Overall = 0.0932                                         max =         15
                    
                                                                    F(16,23784)       =     195.45
                    corr(u_i, Xb) = 0.0613                          Prob > F          =     0.0000
                    
                    ------------------------------------------------------------------------------
                         ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                    -------------+----------------------------------------------------------------
                             age |   .0728746   .0107894     6.75   0.000     .0517267    .0940224
                                 |
                     c.age#c.age |  -.0010113    .000061   -16.57   0.000    -.0011309   -.0008917
                                 |
                            year |
                             69  |   .0647054   .0158222     4.09   0.000     .0336928     .095718
                             70  |   .0284423   .0234621     1.21   0.225     -.017545    .0744295
                             71  |   .0579959   .0326524     1.78   0.076    -.0060048    .1219967
                             72  |   .0510671   .0422995     1.21   0.227    -.0318426    .1339769
                             73  |   .0424104    .052118     0.81   0.416    -.0597442    .1445651
                             75  |   .0151376   .0717194     0.21   0.833    -.1254371    .1557123
                             77  |   .0340933   .0918106     0.37   0.710    -.1458613    .2140478
                             78  |   .0537334   .1023339     0.53   0.600    -.1468475    .2543143
                             80  |   .0369475   .1221806     0.30   0.762    -.2025343    .2764293
                             82  |   .0391687   .1423573     0.28   0.783    -.2398606     .318198
                             83  |    .058766   .1523743     0.39   0.700    -.2398974    .3574294
                             85  |   .1042758   .1726431     0.60   0.546    -.2341157    .4426673
                             87  |   .1242272   .1930108     0.64   0.520    -.2540863    .5025406
                             88  |   .1904977   .2068016     0.92   0.357    -.2148466     .595842
                                 |
                           _cons |   .3937532   .2001741     1.97   0.049     .0013992    .7861072
                    -------------+----------------------------------------------------------------
                         sigma_u |  .40275174
                         sigma_e |  .30127563
                             rho |  .64120306   (fraction of variance due to u_i)
                    ------------------------------------------------------------------------------
                    F test that all u_i=0: F(4709, 23784) = 8.75                 Prob > F = 0.0000
                    
                    . predict fitted, xb
                    (24 missing values generated)
                    
                    . g sq_fitted=fitted^2
                    (24 missing values generated)
                    
                    . xtreg ln_wage fitted sq_fitted, fe
                    
                    Fixed-effects (within) regression               Number of obs     =     28,510
                    Group variable: idcode                          Number of groups  =      4,710
                    
                    R-squared:                                      Obs per group:
                         Within  = 0.1164                                         min =          1
                         Between = 0.1094                                         avg =        6.1
                         Overall = 0.0941                                         max =         15
                    
                                                                    F(2,23798)        =    1568.17
                    corr(u_i, Xb) = 0.0619                          Prob > F          =     0.0000
                    
                    ------------------------------------------------------------------------------
                         ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
                    -------------+----------------------------------------------------------------
                          fitted |   2.012332   .3976379     5.06   0.000     1.232936    2.791727
                       sq_fitted |  -.3040363   .1193029    -2.55   0.011    -.5378776   -.0701949
                           _cons |  -.8379964   .3301923    -2.54   0.011    -1.485194   -.1907985
                    -------------+----------------------------------------------------------------
                         sigma_u |  .40239556
                         sigma_e |  .30114591
                             rho |  .64099409   (fraction of variance due to u_i)
                    ------------------------------------------------------------------------------
                    F test that all u_i=0: F(4709, 23798) = 8.75                 Prob > F = 0.0000
                    
                    . test sq_fitted
                    
                     ( 1)  sq_fitted = 0
                    
                           F(  1, 23798) =    6.49
                                Prob > F =    0.0108
                    
                    .
                    In the previous toy-example the model is clearly misspecified as the -test- outcome on -sq_fitted- reaches statistical significance;

                    5) as Andrew already advised you about, you should go -robust- standard errors.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      Carlo Lazzaro is more attentive than I am, and I naturally agree with all of his excellent points.

                      Comment


                      • #12
                        Andrew Musau : I simply took shameless advantage from your excellent assist!
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          Andrew and Carlo,
                          Thankyou very much for the responses!

                          Comment

                          Working...
                          X