Announcement

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

  • STATA: HAUSMAN Test

    I have different result in using rhausman vs xtoverid in Hausman Test for Data Panel. Could you help me to solve with the best model?


    . xtset ID YEAR

    Panel variable: ID (strongly balanced)
    Time variable: YEAR, 2012 to 2021
    Delta: 1 unit
    . xtreg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL, re
    Random-effects GLS regression Number of obs = 820
    Group variable: ID Number of groups = 82
    R-squared: Obs per group:
    Within = 0.0582 min = 10
    Between = 0.1582 avg = 10.0
    Overall = 0.1327 max = 10
    Wald chi2(7) = 60.24
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
    TOBINSQ Coefficient Std. err. z P>z [95% conf. interval]
    MVAIC .1984099 .0394648 5.03 0.000 .1210604 .2757594
    DPR -.0483234 .0915305 -0.53 0.598 -.2277199 .1310731
    DER -.7312765 .1455461 -5.02 0.000 -1.016542 -.4460115
    SIZE .1176504 .0785496 1.50 0.134 -.036304 .2716048
    AGE .1241954 .2387606 0.52 0.603 -.3437668 .5921577
    GDP -.2313633 1.105906 -0.21 0.834 -2.3989 1.936174
    INFL 5.863882 2.525215 2.32 0.020 .9145527 10.81321
    _cons -.2438746 .8669913 -0.28 0.778 -1.943146 1.455397
    sigma_u 1.1853203
    sigma_e .79635106
    rho .68900172 (fraction of variance due to u_i)
    . xtreg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL, fe
    Fixed-effects (within) regression Number of obs = 820
    Group variable: ID Number of groups = 82
    R-squared: Obs per group:
    Within = 0.0609 min = 10
    Between = 0.0993 avg = 10.0
    Overall = 0.0904 max = 10
    F(7,731) = 6.77
    corr(u_i, Xb) = 0.0566 Prob > F = 0.0000
    TOBINSQ Coefficient Std. err. t P>t [95% conf. interval]
    MVAIC .1470755 .0411792 3.57 0.000 .0662318 .2279191
    DPR -.1254703 .0917153 -1.37 0.172 -.3055271 .0545865
    DER -.7791355 .156089 -4.99 0.000 -1.085572 -.4726994
    SIZE .1676709 .1490193 1.13 0.261 -.1248859 .4602277
    AGE -.0902883 .3840589 -0.24 0.814 -.8442783 .6637016
    GDP -.3076789 1.111873 -0.28 0.782 -2.490524 1.875166
    INFL 5.527369 2.568913 2.15 0.032 .4840413 10.5707
    _cons .6033705 1.25904 0.48 0.632 -1.868395 3.075136
    sigma_u 1.4100819
    sigma_e .79635106
    rho .75817975 (fraction of variance due to u_i)
    F test that all u_i=0: F(81, 731) = 25.58 Prob > F = 0.0000
    . reg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL
    Source SS df MS Number of obs = 820
    F(7, 812) = 32.45
    Model 497.257251 7 71.0367501 Prob > F = 0.0000
    Residual 1777.33082 812 2.18883105 R-squared = 0.2186
    Adj R-squared = 0.2119
    Total 2274.58807 819 2.77727481 Root MSE = 1.4795
    TOBINSQ Coefficient Std. err. t P>t [95% conf. interval]
    MVAIC .467226 .0421503 11.08 0.000 .3844896 .5499624
    DPR .8405944 .13371 6.29 0.000 .5781364 1.103052
    DER -.6387247 .1347102 -4.74 0.000 -.903146 -.3743034
    SIZE .0544056 .0371676 1.46 0.144 -.0185504 .1273616
    AGE .2278863 .1176803 1.94 0.053 -.0031072 .4588798
    GDP -.5932197 1.918164 -0.31 0.757 -4.358363 3.171924
    INFL 7.58951 3.723769 2.04 0.042 .2801622 14.89886
    _cons -2.305617 .463206 -4.98 0.000 -3.21484 -1.396395
    . estimates store fe
    .
    . estimates store re
    .
    . estimate store ols
    .
    . estimates table fe re ols, star stats( n r2 r2_a)
    Variable fe re ols
    MVAIC .46722603*** .46722603*** .46722603***
    DPR .84059438*** .84059438*** .84059438***
    DER -.63872466*** -.63872466*** -.63872466***
    SIZE .05440562 .05440562 .05440562
    AGE .22788628 .22788628 .22788628
    GDP -.59321973 -.59321973 -.59321973
    INFL 7.5895101* 7.5895101* 7.5895101*
    _cons -2.3056174*** -2.3056174*** -2.3056174***
    n
    r2 .2186142 .2186142 .2186142
    r2_a .21187812 .21187812 .21187812
    Legend: * p<0.05;>
    . hausman fe re
    Note: the rank of the differenced variance matrix (0) does not equal the number of coefficients being tested (7); 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.
    MVAIC .467226 .467226 0 0
    DPR .8405944 .8405944 0 0
    DER -.6387247 -.6387247 0 0
    SIZE .0544056 .0544056 0 0
    AGE .2278863 .2278863 0 0
    GDP -.5932197 -.5932197 0 0
    INFL 7.58951 7.58951 0 0
    b = Consistent under H0 and Ha; obtained from regress.
    B = Inconsistent under Ha, efficient under H0; obtained from regress.
    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)
    . quietly xtreg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL, re
    .
    . estimates store re
    .
    . quietly xtreg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL, fe
    .
    . estimates store fe
    .
    .
    .
    . hausman fe re
    Coefficients ----
    (b) (B) (b-B) sqrt(diag(V_b-V_B))
    fe re Difference Std. err.
    MVAIC .1470755 .1984099 -.0513344 .0117584
    DPR -.1254703 -.0483234 -.0771469 .0058189
    DER -.7791355 -.7312765 -.047859 .0563925
    SIZE .1676709 .1176504 .0500205 .1266361
    AGE -.0902883 .1241954 -.2144838 .3008232
    GDP -.3076789 -.2313633 -.0763156 .1150308
    INFL 5.527369 5.863882 -.3365128 .4718132
    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(7) = (b-B)'[(V_b-V_B)^(-1)](b-B)
    = -1261.06
    Warning: chi2 < 0 ==> model fitted on these data
    fails to meet the asymptotic assumptions
    of the Hausman test; see suest for a
    generalized test.
    . *Cluster-Robust Hausman Test
    . rhausman fe re, cluster
    bootstrap in progress
    1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5
    .................................................. 50
    .................................................. 100
    Cluster-Robust Hausman Test
    (based on 100 bootstrap repetitions)
    b1: obtained from xtreg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL, fe
    b2: obtained from xtreg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL, re
    Test: Ho: difference in coefficients not systematic
    chi2(7) = (b1-b2)' * [V_bootstrapped(b1-b2)]^(-1) * (b1-b2)
    = 3.44
    Prob>chi2 = 0.8414
    . xtreg TOBINSQ MVAIC DPR DER SIZE AGE GDP INFL, re
    Random-effects GLS regression Number of obs = 820
    Group variable: ID Number of groups = 82
    R-squared: Obs per group:
    Within = 0.0582 min = 10
    Between = 0.1582 avg = 10.0
    Overall = 0.1327 max = 10
    Wald chi2(7) = 60.24
    corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
    TOBINSQ Coefficient Std. err. z P>z [95% conf. interval]
    MVAIC .1984099 .0394648 5.03 0.000 .1210604 .2757594
    DPR -.0483234 .0915305 -0.53 0.598 -.2277199 .1310731
    DER -.7312765 .1455461 -5.02 0.000 -1.016542 -.4460115
    SIZE .1176504 .0785496 1.50 0.134 -.036304 .2716048
    AGE .1241954 .2387606 0.52 0.603 -.3437668 .5921577
    GDP -.2313633 1.105906 -0.21 0.834 -2.3989 1.936174
    INFL 5.863882 2.525215 2.32 0.020 .9145527 10.81321
    _cons -.2438746 .8669913 -0.28 0.778 -1.943146 1.455397
    sigma_u 1.1853203
    sigma_e .79635106
    rho .68900172 (fraction of variance due to u_i)
    . xtoverid
    Test of overidentifying restrictions: fixed vs random effects
    Cross-section time-series model: xtreg re
    Sargan-Hansen statistic 32.538 Chi-sq(7) P-value = 0.0000

    Is the best model Fixed Effect or Random Effect?

  • #2
    Alvira:
    welcome to this forum.
    With 82 panels, I'd go -xtreg,re- with -vce(cluster panelid)- and then -xtoverid-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X