at the moment I have to decide between a random-effect or a fixed-effect model with a binary dependent variable y. The best way to decide between these two models is normally to use the Hausman-Test (e.g. Green 2012). My problem is first, that I don't understand the exact model specifications and second, that I'm not sure if my approach is the right one.
My models look like this: Mixed Effects Model
ModelME<-glmer(populist ~ wkb+ married + age + I(age^2)+(1|pid),
data = phi4,
family = binomial(link = 'logit'),nAGQ=10)
and Fixed Effects Model
ModelFE<-glm(populist ~ wkb+ married + age + I(age^2)+pid,
data = phi4,
family = binomial(link = 'logit'))
and to specify the Hausman-Test I use the code of another question here on stack overflow (https://stackoverflow.com/questions/23630214/hausmans-specification-test-for-glmer-from-lme4).
and then use the test:
phtest_glmer(logitD,logitFE)
with this result:
Hausman Test
data: phi4
chisq = 3234.6, df = 5, p-value < 2.2e-16
alternative hypothesis: one model is inconsistent
So my questions are: 1. Describes (1|pid) the random effect? 2. Is ModelFE even a Fixed Effects Model? 3. Is the result of the Hausman-Test in any way correct? 4. Should I use another package to use the Hausman-Test?
Any help would be appreciated! Thank you. And please tell me, if you need more information!
Best regards,