help rhausman (http://staff.vwi.unibe.ch/kaiser/research.html)

Title

rhausman -- Robust Hausman Specification Test

Syntax

rhausman , [options]

reps(integer) number of bootstrap repetitions

subset(varlist) specify a subset of independent variables

bsdata(newdataset [, replace]) save bootstrapped data to disk

cluster use a cluster-robust bootstrap

where model-1 and model-2 are names under
which estimation results were stored via estimates store.

Note: Factor variables (see fvvarlist) are not allowed in the
command lines of model-1 and model-2.

Description

rhausman performs a (cluster-)robust version of Hausman's specification test.
To use rhausman, perform the following steps:

(1) obtain an estimator that is consistent whether or not the
null hypothesis is true;

(2) store the estimation results under model-1 by using
estimates store;

(3) obtain an estimator that is consistent
under the null hypothesis, but inconsistent
otherwise;

(4) store the estimation results under model-2 by using
estimates store;

(5) use rhausman to perform the test

rhausman model-1 model-2 [, options]

The command rhausman
implements a (cluster-)robust version of the Hausman test based on the
bootstrap and does not require one of the two estimators to be fully
efficient under the null hypothesis.
The test statistic is of the form

H= (b1-b2)' * [V_bootstrapped(b1-b2)]^(-1) * (b1-b2) ~ chi2(k)

where b1 and b2 are (k x 1) vectors of estimated coefficients from models 1 and
2, respectively, and V_bootstrapped(b1-b2) is the covariance
matrix of (b1-b2) computed from the bootstrapped joint distribution.
See Camerion and Trivedi (2005, pp. 717) for more details.

Why should a robust version of the Hausman test be used?
The traditional Hausman test (see hausman) requires one estimator to
be fully efficient under the null hypothesis. This assumption is
demanding and will often be
violated in microeconometrics data.
For example, when testing a random-effects (RE) model vs.
a fixed-effects (FE) model, the traditional Hausman test (see hausman)
cannot be used in the presence of heteroskedasticity or
serial correlation within panels because
in this case, the RE-GLS estimator is not fully efficient.

Independent Variables: Note that the command automatically excludes
from the test the intercept
as well as all those coefficients
that are not identified in one (or both) model(s).

Options

reps(integer) specifies the number of
bootstrap repetitions. Default is 100.

subset(varlist) can be used to perform the test
on a subset of the independent variables.

bsdata(newdataset [, replace]) allows the user
to save the bootstrapped coefficients to disk.

cluster uses a cluster-robust bootstrap procedure.
The cluster variable (panel variable) must be specified prior to the test,
either in
xtset or in the option vce( ) of model-1 and model-2.

Example

/* Fixed Effects vs. Random Effects */

webuse nlswork, clear

xtset idcode

glo xlist "collgrad grade union msp nev_mar age race not_smsa south year"

xtreg ln_wage $xlist, fe

est sto myfe

xtreg ln_wage $xlist, re

est sto myre

rhausman myfe myre, reps(200) cluster

Saved results

rhausman saves the following in r():

Scalars

r(chi2) chi-squared test statistic

r(rank) rank

r(df) degrees of freedom

r(p) p-value

Matrices

r(b_dif) differences in coefficients

r(b_dif_boot) differences in coefficients (boostrap means)

r(V_dif) bootstrapped covariance matrix

References

Cameron, A. Colin, and Pravin K. Trivedi.
Microeconometrics: methods and applications.
Cambridge university press, 2005.

Please cite rhausman as follows

Kaiser, Boris (2014). "RHAUSMAN: Stata module to perform a (cluster-)robust
Hausman test", University of Bern.

Disclaimer

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.

IN NO EVENT WILL THE COPYRIGHT HOLDERS OR THEIR EMPLOYERS, OR ANY OTHER PARTY WHO
MAY MODIFY AND/OR REDISTRIBUTE THIS SOFTWARE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
INABILITY TO USE THE PROGRAM.

Author

For questions, queries or suggestions, please contact

Boris Kaiser, bo.kaiser@gmx.ch