Dear Statalist,
I am running a two-way fixed effect model with IV estimation. I want to run a Hausman test to see whether fixed effect or random effect is better. However, the command hausman or xtoverid seems not work. Which command I should use in this case?
xtivreg adm_tot_log if_comment_lag overall_rating_lag cum_count_lag rn_hrpd black age adl hhi income_log population_log year_dum* (yelp_rating_if_comment_lag = other_bus_rating_if_comment_lag), re
xtoverid
. xtivreg adm_tot_log if_comment_lag overall_rating_lag cum_count_lag rn_hrpd black age adl hhi income_log population_log year_dum* (yelp_rating_if_comment_lag = other_bus_rat
> ing_if_comment_lag), re
G2SLS random-effects IV regression Number of obs = 110,272
Group variable: prov_id Number of groups = 13,784
R-sq: Obs per group:
within = 0.0104 min = 8
between = 0.2155 avg = 8.0
overall = 0.1937 max = 8
Wald chi2(18) = 5070.58
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
adm_tot_log Coef. Std. Err. z P>z [95% Conf. Interval]
yelp_rating_if_comment_lag .0252264 .0066981 3.77 0.000 .0120984 .0383545
if_comment_lag -.034171 .0191339 -1.79 0.074 -.0716727 .0033307
overall_rating_lag1 .005207 .001028 5.07 0.000 .0031923 .0072218
cum_count_lag .0050584 .0011651 4.34 0.000 .0027748 .007342
rn_hrpd -.0068217 .0047138 -1.45 0.148 -.0160606 .0024171
black -.072343 .0251208 -2.88 0.004 -.1215789 -.0231071
age -.0018064 .0005492 -3.29 0.001 -.0028828 -.00073
adl .0065676 .0007712 8.52 0.000 .0050561 .0080791
hhi -.39824 .0290312 -13.72 0.000 -.4551401 -.3413399
income_log -.1680717 .0201817 -8.33 0.000 -.2076272 -.1285163
population_log .1820305 .004984 36.52 0.000 .1722621 .1917989
year_dum1 -.0830194 .0058669 -14.15 0.000 -.0945183 -.0715204
year_dum2 -.0503053 .0050983 -9.87 0.000 -.0602977 -.0403129
year_dum3 -.0472191 .0046216 -10.22 0.000 -.0562774 -.0381609
year_dum4 -.0351608 .0044339 -7.93 0.000 -.0438511 -.0264705
year_dum5 -.0251258 .0040505 -6.20 0.000 -.0330646 -.017187
year_dum6 .0015675 .0038297 0.41 0.682 -.0059387 .0090736
year_dum7 -.0112567 .0037431 -3.01 0.003 -.018593 -.0039204
_cons 5.025589 .2129035 23.61 0.000 4.608305 5.442872
sigma_u .69644218
sigma_e .30343275
rho .84045931 (fraction of variance due to u_i)
Instrumented: yelp_rating_if_comment_lag
Instruments: if_comment_lag overall_rating_lag1 cum_count_lag rn_hrpd black age adl hhi
income_log population_log year_dum1 year_dum2 year_dum3 year_dum4 year_dum5
year_dum6 year_dum7 other_bus_rating_if_comment_lag
. xtoverid
Test of overidentifying restrictions:
Cross-section time-series model: xtivreg g2sls
Sargan-Hansen statistic 0.000 (equation exactly identified)
Thanks
I am running a two-way fixed effect model with IV estimation. I want to run a Hausman test to see whether fixed effect or random effect is better. However, the command hausman or xtoverid seems not work. Which command I should use in this case?
xtivreg adm_tot_log if_comment_lag overall_rating_lag cum_count_lag rn_hrpd black age adl hhi income_log population_log year_dum* (yelp_rating_if_comment_lag = other_bus_rating_if_comment_lag), re
xtoverid
. xtivreg adm_tot_log if_comment_lag overall_rating_lag cum_count_lag rn_hrpd black age adl hhi income_log population_log year_dum* (yelp_rating_if_comment_lag = other_bus_rat
> ing_if_comment_lag), re
G2SLS random-effects IV regression Number of obs = 110,272
Group variable: prov_id Number of groups = 13,784
R-sq: Obs per group:
within = 0.0104 min = 8
between = 0.2155 avg = 8.0
overall = 0.1937 max = 8
Wald chi2(18) = 5070.58
corr(u_i, X) = 0 (assumed) Prob > chi2 = 0.0000
adm_tot_log Coef. Std. Err. z P>z [95% Conf. Interval]
yelp_rating_if_comment_lag .0252264 .0066981 3.77 0.000 .0120984 .0383545
if_comment_lag -.034171 .0191339 -1.79 0.074 -.0716727 .0033307
overall_rating_lag1 .005207 .001028 5.07 0.000 .0031923 .0072218
cum_count_lag .0050584 .0011651 4.34 0.000 .0027748 .007342
rn_hrpd -.0068217 .0047138 -1.45 0.148 -.0160606 .0024171
black -.072343 .0251208 -2.88 0.004 -.1215789 -.0231071
age -.0018064 .0005492 -3.29 0.001 -.0028828 -.00073
adl .0065676 .0007712 8.52 0.000 .0050561 .0080791
hhi -.39824 .0290312 -13.72 0.000 -.4551401 -.3413399
income_log -.1680717 .0201817 -8.33 0.000 -.2076272 -.1285163
population_log .1820305 .004984 36.52 0.000 .1722621 .1917989
year_dum1 -.0830194 .0058669 -14.15 0.000 -.0945183 -.0715204
year_dum2 -.0503053 .0050983 -9.87 0.000 -.0602977 -.0403129
year_dum3 -.0472191 .0046216 -10.22 0.000 -.0562774 -.0381609
year_dum4 -.0351608 .0044339 -7.93 0.000 -.0438511 -.0264705
year_dum5 -.0251258 .0040505 -6.20 0.000 -.0330646 -.017187
year_dum6 .0015675 .0038297 0.41 0.682 -.0059387 .0090736
year_dum7 -.0112567 .0037431 -3.01 0.003 -.018593 -.0039204
_cons 5.025589 .2129035 23.61 0.000 4.608305 5.442872
sigma_u .69644218
sigma_e .30343275
rho .84045931 (fraction of variance due to u_i)
Instrumented: yelp_rating_if_comment_lag
Instruments: if_comment_lag overall_rating_lag1 cum_count_lag rn_hrpd black age adl hhi
income_log population_log year_dum1 year_dum2 year_dum3 year_dum4 year_dum5
year_dum6 year_dum7 other_bus_rating_if_comment_lag
. xtoverid
Test of overidentifying restrictions:
Cross-section time-series model: xtivreg g2sls
Sargan-Hansen statistic 0.000 (equation exactly identified)
Thanks
Comment