| 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"))
x | 
 an object of class    | 
x2 | 
 an object of class   | 
model | 
 a vector containing the names of two models,  | 
data | 
 a   | 
... | 
 further arguments passed to   | 
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 = "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)