| phtest {plm} | R Documentation |
Specification test for panel models.
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, ...)
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. |
The Hausman test is based on the difference of the vectors of coefficients of two different models.
An object of class "htest".
Yves Croissant
Hausman, J.A. (1978), Specification tests in econometrics, Econometrica, 46, pp.1251–1271.
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)