I want to apply the Hausman test to decide whether to use fixed or random effects. I know that the process consists of:
[1] estimating the fixed-effects model
[2] then the random-effects one
[3] then applying the test (e.g., phtest(femethod, remethod)
This works perfectly if the models are estimated with plm
. The problem is the following: I am using pglm, since I need to estimate a negative binomial model with maximum likelihood.
When I perform the test with my pglm
estimates, I get the following message:
"Error in UseMethod("phtest") :no applicable method for 'phtest'
applied to an object of class "c('maxLik', 'maxim', 'list')"
Thus, my question is: How can I perform the Hausman test with maximum likelihood estimates? Is there any way to do it? Otherwise, are there alternative ways to decide between fixed and random effects?
question from:
https://stackoverflow.com/questions/65830435/hausman-test-in-r-with-maximum-likelihood 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…