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,data=NULL, ...)
## S3 method for class 'plms':
phtest(x,...)

Arguments

x an object of class "plms" or "panelmodel",
x2 an object of class "panelmodel",
data
... further arguments.

Details

The Hausman test is based on the difference of the vectors of coefficients of two different models. If the argument of phtest is an object of class plms, the Hausman test compares the within and the random effects model.

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

library(Ecdat)
data(Gasoline)
Gasoline <- pdata.frame(Gasoline,"country","year")
form <- lgaspcar~lincomep+lrpmg+lcarpcap
gas <-  plm(form,data=Gasoline)
phtest(gas)
phtest(gas$between, gas$random)

[Package plm version 0.2-2 Index]