I am working with panel data.
I did the tests and they suggest fixed effect adjustment. However, analyzing the model and context, I cannot safely discard the random effect.
1) With these tests, is it possible to safely say that I only have a fixed effect?
2) How is the code to see the mixed effect (fixed and random effect at the same time)? So how do I do xtreg fe and re, what is the "xtreg" for the mixed effect? xtmixed?
I appreciate any help. Thanks a lot!
subtitle:
Banco = Bank = id
Data = date/time (semesters)
$dependente = dependent
$explicativas = independent variables
xtreg $dependente $explicativas, fe
Fixed-effects (within) regression Number of obs = 3534
Group variable: banco Number of groups = 186
R-sq: within = 0.5596 Obs per group: min = 1
between = 0.5303 avg = 19.0
overall = 0.5155 max = 38
F(22,3326) = 192.07
corr(u_i, Xb) = -0.1482 Prob > F = 0.0000
rho | .67080754 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(185, 3326) = 15.88 Prob > F = 0.0000
Fixed-effects (within) regression Number of obs = 3534
Group variable: banco Number of groups = 186
R-sq: within = 0.5596 Obs per group: min = 1
between = 0.5303 avg = 19.0
overall = 0.5155 max = 38
F(22,3326) = 192.07
corr(u_i, Xb) = -0.1482 Prob > F = 0.0000
rho | .67080754 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(185, 3326) = 15.88 Prob > F = 0.0000
xtreg $dependente $explicativas, re theta
Random-effects GLS regression Number of obs = 3534
Group variable: banco Number of groups = 186
R-sq: within = 0.5572 Obs per group: min = 1
between = 0.7092 avg = 19.0
overall = 0.6631 max = 38
Wald chi2(22) = 4680.29
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
------------------- theta --------------------
min 5% median 95% max
0.2381 0.3606 0.7094 0.8126 0.8126
rho | .41958416 (fraction of variance due to u_i)
Random-effects GLS regression Number of obs = 3534
Group variable: banco Number of groups = 186
R-sq: within = 0.5572 Obs per group: min = 1
between = 0.7092 avg = 19.0
overall = 0.6631 max = 38
Wald chi2(22) = 4680.29
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
------------------- theta --------------------
min 5% median 95% max
0.2381 0.3606 0.7094 0.8126 0.8126
rho | .41958416 (fraction of variance due to u_i)
quietly xtreg $dependente $explicativas, re
xttest0
Breusch and Pagan Lagrangian multiplier test for random effects
inter[banco,t] = Xb + u[banco] + e[banco,t]
Estimated results:
| Var sd = sqrt(Var)
---------+-----------------------------
inter | 480.5217 21.9208
e | 84.10534 9.170897
u | 60.79998 7.797434
Test: Var(u) = 0
chibar2(01) = 5715.62
Prob > chibar2 = 0.0000
xttest0
Breusch and Pagan Lagrangian multiplier test for random effects
inter[banco,t] = Xb + u[banco] + e[banco,t]
Estimated results:
| Var sd = sqrt(Var)
---------+-----------------------------
inter | 480.5217 21.9208
e | 84.10534 9.170897
u | 60.79998 7.797434
Test: Var(u) = 0
chibar2(01) = 5715.62
Prob > chibar2 = 0.0000
quietly xtreg $dependente $explicativas, fe
estimates store fixed
quietly xtreg $dependente $explicativas, re
estimates store random
hausman fixed random
Note: the rank of the differenced variance matrix (19) does not equal the number of coefficients being tested (22); 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.
b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test: Ho: difference in coefficients not systematic
chi2(19) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= -992.36 chi2<0 ==> model fitted on these
data fails to meet the asymptotic
assumptions of the Hausman test;
see suest for a generalized test
estimates store fixed
quietly xtreg $dependente $explicativas, re
estimates store random
hausman fixed random
Note: the rank of the differenced variance matrix (19) does not equal the number of coefficients being tested (22); 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.
b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test: Ho: difference in coefficients not systematic
chi2(19) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= -992.36 chi2<0 ==> model fitted on these
data fails to meet the asymptotic
assumptions of the Hausman test;
see suest for a generalized test
hausman fixed random, sigmamore
b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test: Ho: difference in coefficients not systematic
chi2(19) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 123.82
Prob>chi2 = 0.0000
b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test: Ho: difference in coefficients not systematic
chi2(19) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 123.82
Prob>chi2 = 0.0000
hausman fixed random, sigmaless
b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test: Ho: difference in coefficients not systematic
chi2(19) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 127.54
Prob>chi2 = 0.0000
b = consistent under Ho and Ha; obtained from xtreg
B = inconsistent under Ha, efficient under Ho; obtained from xtreg
Test: Ho: difference in coefficients not systematic
chi2(19) = (b-B)'[(V_b-V_B)^(-1)](b-B)
= 127.54
Prob>chi2 = 0.0000
xi: xtreg $dependente $explicativas, re
xtoverid
Test of overidentifying restrictions: fixed vs random effects
Cross-section time-series model: xtreg re
Sargan-Hansen statistic 127.820 Chi-sq(22) P-value = 0.0000
xtoverid
Test of overidentifying restrictions: fixed vs random effects
Cross-section time-series model: xtreg re
Sargan-Hansen statistic 127.820 Chi-sq(22) P-value = 0.0000
Testing for time-fixed effects
xtreg $dependente $explicativas i.data, fe
Fixed-effects (within) regression Number of obs = 3534
Group variable: banco Number of groups = 186
R-sq: within = 0.5679 Obs per group: min = 1
between = 0.5260 avg = 19.0
overall = 0.5098 max = 38
F(57,3291) = 75.87
corr(u_i, Xb) = -0.1572 Prob > F = 0.0000
rho | .67554064 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(185, 3291) = 15.95 Prob > F = 0.0000
testparm i.data
F( 36, 3291) = 2.46
Prob > F = 0.0000
xtreg $dependente $explicativas i.data, fe
Fixed-effects (within) regression Number of obs = 3534
Group variable: banco Number of groups = 186
R-sq: within = 0.5679 Obs per group: min = 1
between = 0.5260 avg = 19.0
overall = 0.5098 max = 38
F(57,3291) = 75.87
corr(u_i, Xb) = -0.1572 Prob > F = 0.0000
rho | .67554064 (fraction of variance due to u_i)
------------------------------------------------------------------------------
F test that all u_i=0: F(185, 3291) = 15.95 Prob > F = 0.0000
testparm i.data
F( 36, 3291) = 2.46
Prob > F = 0.0000
Wald test
xttest3
Modified Wald test for groupwise heteroskedasticity
in fixed effect regression model
H0: sigma(i)^2 = sigma^2 for all i
chi2 (186) = 1.5e+32
Prob>chi2 = 0.0000
xttest3
Modified Wald test for groupwise heteroskedasticity
in fixed effect regression model
H0: sigma(i)^2 = sigma^2 for all i
chi2 (186) = 1.5e+32
Prob>chi2 = 0.0000
Wooldridge test
xtserial $dependente $explicativas, output
Linear regression Number of obs = 3294
F( 21, 177) = 44.75
Prob > F = 0.0000
R-squared = 0.5291
Root MSE = 7.7268
(Std. Err. adjusted for 178 clusters in banco)
Wooldridge test for autocorrelation in panel data
H0: no first-order autocorrelation
F( 1, 170) = 14.070
Prob > F = 0.0002
.
.
.
. xtserial $dependente $explicativas
Wooldridge test for autocorrelation in panel data
H0: no first-order autocorrelation
F( 1, 170) = 14.070
Prob > F = 0.0002
xtserial $dependente $explicativas, output
Linear regression Number of obs = 3294
F( 21, 177) = 44.75
Prob > F = 0.0000
R-squared = 0.5291
Root MSE = 7.7268
(Std. Err. adjusted for 178 clusters in banco)
Wooldridge test for autocorrelation in panel data
H0: no first-order autocorrelation
F( 1, 170) = 14.070
Prob > F = 0.0002
.
.
.
. xtserial $dependente $explicativas
Wooldridge test for autocorrelation in panel data
H0: no first-order autocorrelation
F( 1, 170) = 14.070
Prob > F = 0.0002
Trying MIXED EFFECT MODEL
xtmixed $dependente $explicativas|| banco:
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -13101.186
Iteration 1: log likelihood = -13101.186
Computing standard errors:
Mixed-effects ML regression Number of obs = 3534
Group variable: banco Number of groups = 186
Obs per group: min = 1
avg = 19.0
max = 38
Wald chi2(22) = 4628.55
Log likelihood = -13101.186 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
banco: Identity |
sd(_cons) | 9.789867 .5879408 8.70276 11.01277
-----------------------------+------------------------------------------------
sd(Residual) | 9.159925 .1122329 8.942573 9.38256
------------------------------------------------------------------------------
LR test vs. linear regression: chibar2(01) = 1512.54 Prob >= chibar2 = 0.0000
.
.
.
. estat ic
-----------------------------------------------------------------------------
Model | Obs ll(null) ll(model) df AIC BIC
-------------+---------------------------------------------------------------
. | 3534 . -13101.19 25 26252.37 26406.63
-----------------------------------------------------------------------------
Note: N=Obs used in calculating BIC; see [R] BIC note
xtmixed $dependente $explicativas|| banco:
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -13101.186
Iteration 1: log likelihood = -13101.186
Computing standard errors:
Mixed-effects ML regression Number of obs = 3534
Group variable: banco Number of groups = 186
Obs per group: min = 1
avg = 19.0
max = 38
Wald chi2(22) = 4628.55
Log likelihood = -13101.186 Prob > chi2 = 0.0000
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
banco: Identity |
sd(_cons) | 9.789867 .5879408 8.70276 11.01277
-----------------------------+------------------------------------------------
sd(Residual) | 9.159925 .1122329 8.942573 9.38256
------------------------------------------------------------------------------
LR test vs. linear regression: chibar2(01) = 1512.54 Prob >= chibar2 = 0.0000
.
.
.
. estat ic
-----------------------------------------------------------------------------
Model | Obs ll(null) ll(model) df AIC BIC
-------------+---------------------------------------------------------------
. | 3534 . -13101.19 25 26252.37 26406.63
-----------------------------------------------------------------------------
Note: N=Obs used in calculating BIC; see [R] BIC note
0 Response to Mixed Effect Model? (Fixed + Random)
Post a Comment