Skip to content
Prev 247455 / 398503 Next

Hausman Test

On Sun, 16 Jan 2011, Holger Steinmetz wrote:

            
Hausman tests can be used for comparisons of various models. The 
implementation in systemfit is intended for comparison of 2SLS and 3SLS 
but can also be (ab)used for comparison of 2SLS and OLS. You just have to 
enter the models in the reverse order, i.e., hausman.systemfit(fit2sls, 
fitOLS).

A worked example that computes the test statistic "by hand" is also 
included in

   help("Baltagi2002", package = "AER")

in the section about the US consumption data, Chapter 11.

An adaptation is also shown below:

   ## data
   library("AER")
   data("USConsump1993", package = "AER")
   usc <- as.data.frame(USConsump1993)
   usc$investment <- usc$income - usc$expenditure

   ## 2SLS via ivreg(), Hausman by hand
   fm_ols <- lm(expenditure ~ income, data = usc)
   fm_iv <- ivreg(expenditure ~ income | investment, data = usc)
   cf_diff <- coef(fm_iv) - coef(fm_ols)
   vc_diff <- vcov(fm_iv) - vcov(fm_ols)
   x2_diff <- as.vector(t(cf_diff) %*% solve(vc_diff) %*% cf_diff)
   pchisq(x2_diff, df = 2, lower.tail = FALSE)

   ## 2SLS via systemfit(), Hausman via hausman.systemfit()
   library("systemfit")
   sm_ols <- systemfit(expenditure ~ income, data = usc, method = "OLS")
   sm_iv <- systemfit(expenditure ~ income, data = usc, method = "2SLS",
     inst = ~ investment)
   hausman.systemfit(sm_iv, sm_ols)

hth,
Z