Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.

# st: random effect panel data and Durbin-Wu-Hausman

 From Montserrat Viladrich Grau To statalist@hsphsun2.harvard.edu Subject st: random effect panel data and Durbin-Wu-Hausman Date Thu, 11 Nov 2010 18:29:42 +0100

```I have a problem with the Durbin-Wu-Hausman statistic when I wanted to
compare an instrumentalized equation against the non-instrumentalized
version.So I decided to apply the xtoverid statistic.

But, I am missing something, because I am not quite sure that I am
understand the results of the xtoverid in the case of xtivreg. I would
be very grateful if someone can tell me if my interpretation of the
results  from the xtoverid test is correct.And, if it is not, please can
somebody to tell me how I should interpret these results.

For example, I understand that in the cases that I apply xtoverid on
xtreg regression and we cannot accept the null that means that the
estimation is not consistent and I need to solve the problem using for
example IV.  If this interpretation is correct my main question is how
to interpret a xtoverid test on xtivreg. For example, if in this case we
could accept the null then we could conclude that the instruments are
not correlated with the error term and therefore the IV estimation
was consistent.

But, if we could not accept the null (xtoverid on xtivreg)  that
would mean that the instruments could be correlated with the error term?

And finally, Another question that I would like to ask is if there is
another way of testing endogeneity in random effect panel data regressions?.

*Thank you very much for your help.
Montse

Next I include the output from my regressions.

OUTPUT:

. xtivreg c sc da si sexo economia (nv0

pv0=nv3 pv3 nv30n pv30n), re i (subject)

G2SLS random-effects IV regressionNumber of obs=2296

Group variable: subjectNumber of groups=128

R-sq:within= 0.0809Obs per group: min =12

between = 0.3593avg =17.9

overall = 0.2256max =19

Wald chi2(7)=150.37

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

------------------------------------------------------------------------------

c |Coef.Std. Err.zP>|z|[95% Conf. Interval]

-------------+----------------------------------------------------------------

nv0 |.0289927.00357868.100.000.0219787.0360066

pv0 |.0270765.01055522.570.010.0063886.0477644

sc |-4.5318041.323553-3.420.001-7.125921-1.937687

da |1.7356251.3673031.270.204-.94423944.415489

si |.0020259.00033236.100.000.0013746.0026772

sexo |-.84153451.350943-0.620.533-3.4893341.806265

economia |1.036721.6726330.620.535-2.2415814.315021

_cons |5.9801481.8529233.230.0012.3484869.611811

-------------+----------------------------------------------------------------

sigma_u |7.2936313

sigma_e |4.9408179

rho |.6854519(fraction of variance due to u_i)

------------------------------------------------------------------------------

Instrumented:nv0 pv0

Instruments:sc da si sexo economia nv3 pv3 nv30n pv30n

------------------------------------------------------------------------------

. estimates store appropiv

. xtreg c nv0 pv0 sc da si sexo economia, re i(subject)

Random-effects GLS regressionNumber of obs=2424

Group variable: subjectNumber of groups=128

R-sq:within= 0.0792Obs per group: min =13

between = 0.4041avg =18.9

overall = 0.2517max =20

Random effects u_i ~ GaussianWald chi2(7)=284.96

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

------------------------------------------------------------------------------

c |Coef.Std. Err.zP>|z|[95% Conf. Interval]

-------------+----------------------------------------------------------------

nv0 |.0332418.002704612.290.000.0279408.0385428

pv0 |-.0125865.0076896-1.640.102-.0276579.0024848

sc |-3.495937.8236531-4.240.000-5.110267-1.881606

da |1.497511.84257861.780.076-.15391253.148935

si |.001667.00033165.030.000.0010169.002317

sexo |-.8168605.8305706-0.980.325-2.444749.8110279

economia |.88598071.0280020.860.389-1.1288662.900827

_cons |5.9926621.1419975.250.0003.7543898.230934

-------------+----------------------------------------------------------------

sigma_u |4.3079432

sigma_e |4.941569

rho |.43181628(fraction of variance due to u_i)

------------------------------------------------------------------------------

. estimates store approp

. hausman appropiv approp, constant

Note: the rank of the differenced variance matrix (7) does not equal the
number of coefficients being tested (8); 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))

|appropivappropDifferenceS.E.

-------------+----------------------------------------------------------------

nv0 |.0289927.0332418-.0042492.0023434

pv0 |.0270765-.0125865.039663.0072307

sc |-4.531804-3.495937-1.0358671.036045

da |1.7356251.497511.23811381.076837

si |.0020259.001667.000359.000021

sexo |-.8415345-.8168605-.0246741.065457

economia |1.03672.8859807.15073921.319437

_cons |5.9801485.992662-.01251311.459166

------------------------------------------------------------------------------

b = consistent under Ho and Ha; obtained from xtivreg

B = inconsistent under Ha, efficient under Ho; obtained from xtreg

Test:Ho:difference in coefficients not systematic

chi2(7) = (b-B)'[(V_b-V_B)^(-1)](b-B)

=57.11

Prob>chi2 =0.0000

(V_b-V_B is not positive definite)

THEN

. xtreg c nv0 pv0 sc da si sexo economia, re i(subject)

Random-effects GLS regressionNumber of obs=2424

Group variable: subjectNumber of groups=128

R-sq:within= 0.0792Obs per group: min =13

between = 0.4041avg =18.9

overall = 0.2517max =20

Random effects u_i ~ GaussianWald chi2(7)=284.96

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

------------------------------------------------------------------------------

c |Coef.Std. Err.zP>|z|[95% Conf. Interval]

-------------+----------------------------------------------------------------

nv0 |.0332418.002704612.290.000.0279408.0385428

pv0 |-.0125865.0076896-1.640.102-.0276579.0024848

sc |-3.495937.8236531-4.240.000-5.110267-1.881606

da |1.497511.84257861.780.076-.15391253.148935

si |.001667.00033165.030.000.0010169.002317

sexo |-.8168605.8305706-0.980.325-2.444749.8110279

economia |.88598071.0280020.860.389-1.1288662.900827

_cons |5.9926621.1419975.250.0003.7543898.230934

-------------+----------------------------------------------------------------

sigma_u |4.3079432

sigma_e |4.941569

rho |.43181628(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 statistic17.158Chi-sq(3)P-value = 0.0007

-------------------------------------------------------------------------------------------------------

. xtivreg c sc da si sexo economia (nv0 pv0=nv3 pv3 nv30n pv30n), re i
(subject)

G2SLS random-effects IV regressionNumber of obs=2296

Group variable: subjectNumber of groups=128

R-sq:within= 0.0809Obs per group: min =12

between = 0.3593avg =17.9

overall = 0.2256max =19

Wald chi2(7)=150.37

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

------------------------------------------------------------------------------

c |Coef.Std. Err.zP>|z|[95% Conf. Interval]

-------------+----------------------------------------------------------------

nv0 |.0289927.00357868.100.000.0219787.0360066

pv0 |.0270765.01055522.570.010.0063886.0477644

sc |-4.5318041.323553-3.420.001-7.125921-1.937687

da |1.7356251.3673031.270.204-.94423944.415489

si |.0020259.00033236.100.000.0013746.0026772

sexo |-.84153451.350943-0.620.533-3.4893341.806265

economia |1.036721.6726330.620.535-2.2415814.315021

_cons |5.9801481.8529233.230.0012.3484869.611811

-------------+----------------------------------------------------------------

sigma_u |7.2936313

sigma_e |4.9408179

rho |.6854519(fraction of variance due to u_i)

------------------------------------------------------------------------------

Instrumented:nv0 pv0

Instruments:sc da si sexo economia nv3 pv3 nv30n pv30n

------------------------------------------------------------------------------

. xtoverid

Test of overidentifying restrictions:

Cross-section time-series model: xtivreg g2sls

Sargan-Hansen statistic1.614Chi-sq(2)P-value = 0.4463

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```