phtest {plm}R Documentation

Hausman Test for Panel Models

Description

Specification test for panel models.

Usage

phtest(x, ...)
## S3 method for class 'panelmodel':
phtest(x, x2, ...)
## S3 method for class 'formula':
phtest(x, data, model = c("within","random"),
    effect = "individual", index = NULL, ...)

Arguments

x an object of class "panelmodel" or "formula",
x2 an object of class "panelmodel",
model a vector containing the names of two models,
effect the effects introduced in the model, one of "individual", "time" or "twoways",
data a data.frame,
index the index of the data.frame,
... further arguments.

Details

The Hausman test is based on the difference of the vectors of coefficients of two different models.

Value

An object of class "htest".

Author(s)

Yves Croissant

References

Hausman, J.A. (1978), Specification tests in econometrics, Econometrica, 46, pp.1251–1271.

Examples

data("Gasoline",package="Ecdat")
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)

[Package plm version 0.3-2 Index]