Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

phtest

Hausman Test for Panel Models


Description

Specification test for panel models.

Usage

phtest(x, ...)

## S3 method for class 'formula'
phtest(
  x,
  data,
  model = c("within", "random"),
  method = c("chisq", "aux"),
  index = NULL,
  vcov = NULL,
  ...
)

## S3 method for class 'panelmodel'
phtest(x, x2, ...)

Arguments

x

an object of class "panelmodel" or "formula",

...

further arguments to be passed on. For the formula method, place argument effect here to compare, e.g., twoway models (effect = "twoways") Note: Argument effect is not respected in the panelmodel method.

data

a data.frame,

model

a character vector containing the names of two models (length(model) must be 2),

method

one of "chisq" or "aux",

index

an optional vector of index variables,

vcov

an optional covariance function,

x2

an object of class "panelmodel",

Details

The Hausman test (sometimes also called Durbin–Wu–Hausman test) is based on the difference of the vectors of coefficients of two different models. The panelmodel method computes the original version of the test based on a quadratic form (Hausman 1978). The formula method, if method="chisq" (default), computes the original version of the test based on a quadratic form; if method="aux" then the auxiliary-regression-based version in Wooldridge (2010, Sec. 10.7.3.) is computed instead (WOOL:10 Sec.10.7.3). Only the latter can be robustified by specifying a robust covariance estimator as a function through the argument vcov (see Examples).

The equivalent tests in the one-way case using a between model (either "within vs. between" or "random vs. between") (see Hausman and Taylor 1981 or Baltagi 2013 Sec.4.3) can also be performed by phtest, but only for test = "chisq", not for the regression-based test. NB: These equivalent tests using the between model do not extend to the two-ways case. There are, however, some other equivalent tests, (see Kang 1985 or Baltagi 2013 Sec.4.3.7), but those are unsupported by phtest.

Value

An object of class "htest".

Author(s)

Yves Croissant, Giovanni Millo

References

Hausman JA (1978). “Specification Tests in Econometrics.” Econometrica, 46, 1251–1271.

Hausman JA, Taylor WE (1981). “Panel Data and Unobservable Individual Effects.” Econometrica, 49, 1377–1398.

Kang S (1985). “A note on the equivalence of specification tests in the two-factor multivariate variance components model.” Journal of Econometrics, 28(2), 193–203. ISSN 0304-4076, https://www.sciencedirect.com/science/article/pii/0304407685901198.

Wooldridge JM (2010). Econometric Analysis of Cross–Section and Panel Data. MIT press.

Baltagi BH (2013). Econometric Analysis of Panel Data, 5th edition. John Wiley and Sons ltd.

Examples

data("Gasoline", package = "plm")
form <- lgaspcar ~ lincomep + lrpmg + lcarpcap
wi <- plm(form, data = Gasoline, model = "within")
re <- plm(form, data = Gasoline, model = "random")
phtest(wi, re)
phtest(form, data = Gasoline)
phtest(form, data = Gasoline, method = "aux")

# robust Hausman test (regression-based)
phtest(form, data = Gasoline, method = "aux", vcov = vcovHC)

# robust Hausman test with vcov supplied as a
# function and additional parameters
phtest(form, data = Gasoline, method = "aux",
  vcov = function(x) vcovHC(x, method="white2", type="HC3"))

plm

Linear Models for Panel Data

v2.4-1
GPL (>= 2)
Authors
Yves Croissant [aut, cre], Giovanni Millo [aut], Kevin Tappe [aut], Ott Toomet [ctb], Christian Kleiber [ctb], Achim Zeileis [ctb], Arne Henningsen [ctb], Liviu Andronic [ctb], Nina Schoenfelder [ctb]
Initial release
2021-03-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.