htest_pglm function

Specification test for panel glm models

Specification test for panel glm models

This function performs Hausman specification test for panel glm.

latin1

htest_pglm(RE, FE, re.method)

Arguments

  • RE: Random effect objects. Support pglm, glmer, glmmTMB
  • FE: Fixed effect objects.
  • re.method: Method that used to estimate the random effect estimation, in addition to "pglm", it also supports "glmmTMB" of package glmmTMB, and "glmer" of package lme4.

References

Hausman J.A. (1978). Specification Tests in Econometrics. Econometrica, 46, 1251-1271.

Author(s)

Ho Tsung-wu tsungwu@ntnu.edu.tw, modifed from phtest() of plm

Examples

data(ship) library(pglm) Eq1="accident ~ op_75_79+co_65_69+co_70_74+co_75_79" FE.pois <- pglm(Eq1,data=ship,family = "poisson",model = "within",index = 'ship',R=10) RE.pois <- pglm::pglm(Eq1,data=ship,family = "poisson", model = "random", index = 'ship') ## Hausman test htest_pglm(RE=RE.pois, FE=FE.pois, re.method="pglm") Eq2=accident ~ op_75_79+co_65_69+co_70_74+co_75_79 + (1 | ship) re.glmmTMB=glmmTMB::glmmTMB(Eq2,data=ship, family="poisson") ## Hausman test htest_pglm(RE=re.glmmTMB, FE=FE.pois, re.method="glmmTMB")
  • Maintainer: Ho Tsung-wu
  • License: GPL (>= 2)
  • Last published: 2024-08-18

Useful links