library(plm)
data("EmplUK", package = "plm")
phtest(wage ~ emp + capital + output, data = EmplUK,
effect = "individual", model = c("within", "random"),
index = c("firm", "year")
)
Hausman Test
data: wage ~ emp + capital + output
chisq = 3.9812, df = 3, p-value = 0.2635
alternative hypothesis: one model is inconsistent