4

I have a model with two random effects

> lmer(TotalPayoff~Type+Game+PgvnD*Asym+(1|Subject)+(1|Pairing),REML=FALSE,data=table)-    
>m1

each pairing contains 2 subjects and each Subject is in 2 different pairings with different subjects. For some reason the subject random effect has SD =0 I do not understand this? Is it something wrong with how I structured my random effects?

> m1
Linear mixed model fit by maximum likelihood 
Formula: TotalPayoff ~ Type + Game + PgvnD * Asym + (1 | Pairing) + (1 |      Subject) 
   Data: table 
  AIC  BIC logLik deviance REMLdev
 1014 1038 -497.8    995.6   964.4
Random effects:
 Groups   Name        Variance Std.Dev.
 Subject  (Intercept)   0.000   0.0000 
 Pairing  (Intercept) 716.102  26.7601 
 Residual              89.364   9.4532 
Number of obs: 113, groups: Subject, 73; Pairing, 61

Fixed effects:
            Estimate Std. Error t value
(Intercept)   58.428     12.255   4.768
Type           7.926      2.852   2.779
Game          15.374      7.147   2.151
PgvnD         -8.466      7.554  -1.121
Asym         -12.167      7.583  -1.604
PgvnD:Asym    26.618      9.710   2.741

Correlation of Fixed Effects:
           (Intr) Type   Game   PgvnD  Asym  
Type       -0.335                            
Game       -0.835  0.009                     
PgvnD      -0.098 -0.038 -0.010              
Asym       -0.330  0.081 -0.015  0.189       
PgvnD:Asym  0.189 -0.267 -0.011 -0.766 -0.328
Jeremy Miles
  • 13,917
  • 6
  • 30
  • 64
Jonathan Bone
  • 1,093
  • 3
  • 17
  • 23

1 Answers1

11

Sometimes the maximum likelihood estimate for a variance component is zero. Or more generally, sometimes a given algorithm for getting approximate MLEs will return zero. This happens when, for example, your fixed effects happen to be able to fit all the members of a group perfectly, and no variance is left over. This is mainly an issue when the sample size is small relative to the number of groups.

Doug Bates, the author of the lme4 package, discusses this on page 11 of his book/manual on R-Forge. He calls it a "degenerate" model, and says it's equivalent to if you didn't include that random effect at all. The model is still valid, but you may have reasons not to trust its estimates, as discussed below.

Andrew Gelman and a bunch of collaborators discuss the issue in more depth here. They think that pure maximum likelihood's tendency to return zeros in this case can cause a number of problems (discussed on page 2).

They suggest weakly bumping the expected variance of the random effects up slightly to make it return nonzero estimates. These adjusted estimates can be more stable, and may be more consistent with a researcher's prior knowledge about the problem. This approach will also tend to give better standard errors. While the approach they suggest is Bayesian, they show that it has good frequency properties as well.

One of the authors, Vincent Dorie, has an R package that extends lme4 using their suggested method here.

David J. Harris
  • 11,178
  • 2
  • 30
  • 53
  • Interesting reply, I gave +1. But what about if it was not the std.dev. of the slope, but of a variable, that was equal zero? It does not necessarily mean the model with and without that random effect would be the same, just as Bates points for this case o std.dv. of intercepts being zero. – R.Astur Apr 19 '13 at 06:00
  • Thanks, I have read suggestions that as the Subject random effect is not significant (I have tested) I should remove it from the model. What is your opinion on this? – Jonathan Bone Apr 19 '13 at 11:36
  • @R.Astur I'm not sure I understand your distinction. Did I misinterpret something Bates said? It's been a while since I gave the lme4 stuff a close reading. – David J. Harris Apr 19 '13 at 19:23
  • @JonathanBone I tend to use AIC rather than significance to make that kind of decision, but it can definitely be reasonable to prune the model if some of the variables you included aren't worth estimating. It depends on what your goals are. – David J. Harris Apr 19 '13 at 19:26
  • Ooops, sorry @David-J.-Harris, I used the wrong wording: I said slope, while I wanted to say intercept. Let me try again: I understand that when a model with only an intercept in the random effects has std dev=0 (the case of the original question), we have a degenerate model. My thinking-loud-comment was: what about a model where you have the intercept random effects at 2nd level with std dev>0 (say, 0.09), but the random effect of the slope of the variable of interest has std dev=0? It seems to me that this model would not be degenerated, i.e. it would make sense to estimate it. – R.Astur Apr 20 '13 at 05:01