I have very recently started learning about Generalised Linear Mixed Models and was using R to explore what difference it makes to treat group membership as either fixed or random effect. In particular, I am looking at the example dataset discussed here:
http://www.ats.ucla.edu/stat/mult_pkg/glmm.htm
http://www.ats.ucla.edu/stat/r/dae/melogit.htm
As outlined in this tutorial, the effect of Doctor ID is appreciable and I was expecting the mixed model with a random intercept to give better results. However, comparing AIC values for the two methods suggest that this model is worse:
> require(lme4) ; hdp = read.csv("http://www.ats.ucla.edu/stat/data/hdp.csv")
> hdp$DID = factor(hdp$DID) ; hdp$Married = factor(hdp$Married)
> GLM = glm(remission~Age+Married+IL6+DID,data=hdp,family=binomial);summary(GLM)
Call:
glm(formula = remission ~ Age + Married + IL6 + DID, family = binomial,
data = hdp)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.5265 -0.6278 -0.2272 0.5492 2.7329
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -1.560e+01 1.219e+03 -0.013 0.990
Age -5.869e-02 5.272e-03 -11.133 < 2e-16 ***
Married1 2.688e-01 6.646e-02 4.044 5.26e-05 ***
IL6 -5.550e-02 1.153e-02 -4.815 1.47e-06 ***
DID2 1.805e+01 1.219e+03 0.015 0.988
DID3 1.932e+01 1.219e+03 0.016 0.987
[...]
DID405 1.566e+01 1.219e+03 0.013 0.990
DID405 1.566e+01 1.219e+03 0.013 0.990
DID406 -2.885e-01 3.929e+03 0.000 1.000
DID407 2.012e+01 1.219e+03 0.017 0.987
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 10353 on 8524 degrees of freedom
Residual deviance: 6436 on 8115 degrees of freedom
AIC: 7256
Number of Fisher Scoring iterations: 17
> GLMM = glmer(remission~Age+Married+IL6+(1|DID),data=hdp,family=binomial) ; m
Generalized linear mixed model fit by the Laplace approximation
Formula: remission ~ Age + Married + IL6 + (1 | DID)
Data: hdp
AIC BIC logLik deviance
7743 7778 -3867 7733
Random effects:
Groups Name Variance Std.Dev.
DID (Intercept) 3.8401 1.9596
Number of obs: 8525, groups: DID, 407
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 1.461438 0.272709 5.359 8.37e-08 ***
Age -0.055969 0.005038 -11.109 < 2e-16 ***
Married1 0.260065 0.063736 4.080 4.50e-05 ***
IL6 -0.053288 0.011058 -4.819 1.44e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) Age Marrd1
Age -0.898
Married1 0.070 -0.224
IL6 -0.162 0.012 -0.033
> extractAIC(GLM) ; extractAIC(GLMM)
[1] 410.000 7255.962
[1] 5.000 7743.188
Thus, my questions are:
(1) Is it appropriate to compare the AIC values provided by the two functions? If so, why does the fixed effect model do better?
(2) What is the best way to identify if fixed or random effects are more important (ie to quantify that the variability due to the doctor is more important than patient characteristics?