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"))

Arguments

x

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

x2

an object of class "panelmodel",

model

a vector containing the names of two models,

data

a data.frame,

...

further arguments passed to plm

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 = "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)

[Package plm version 1.2-10 Index]