[R-sig-ME] Random slope does not improve hierarchical fitting across time

Ben Bolker bbolker at gmail.com
Fri Jul 29 21:48:26 CEST 2016



On 16-07-29 03:09 PM, xavier piulachs wrote:
> Dear members of mixed-models list,
> 
> 
> I'm adressing you in order to ask a question about Hierarchical and ZI counts measured over time.
> To have preliminar results, I'm modeling longitudinal data with a Negative Binomial GLMM, via
> lme4 and glmmADBM packages (very similar results). I have considered two possibilities:
> 
> 
> 1) A single random intercept:
> glmer.0.int.NB <- glmer.nb(counts ~ obstime + (1|id), data = tr.j)    # lme4 package
> 
> tr.j$ID <- as.factor(tr.j$id)
> glmmADMB.0.int.NB <- glmmadmb(claimyr ~ obstime + (1|ID), data = tr.j, family = "nbinom")
>             Estimate Std. Error z value Pr(>|z|)
> (Intercept)  -0.9652     0.1222 -7.9005   0.0000
> obstime       0.0238     0.0073  3.2735   0.0011
> 
> 
> 2) Random intercept and random slope effects:
> glmer.0.slp.NB <- glmer.nb(counts ~ obstime + (obstime|id), data = tr.j)   #  lme4 package
> 
> glmmADMB.0.slp.NB <- glmmadmb(claimyr ~ obstime + (obstime|ID), data = tr.j, family = "nbinom")
>             Estimate Std. Error z value Pr(>|z|)
> (Intercept)  -0.9401     0.1190 -7.9005   0.0000
> obstime       0.0230     0.0075  3.0540   0.0023
> 
> 
> Surprisingly, the anova test indicates non significant improvement by fitting second model:
> 
> anova(glmer.0.int.NB, glmer.0.slp.NB)  # LRT: p-value = 0.2725 > 0.05
> anova(glmmADMB.0.int.NB, glmmADMB.0.slp.NB) # LRT: p-value = 0.1042 > 0.05
> 
> 
> As far as I know, when dealing repeated measurements across time, we expect that outcomes closer in time to be
> more correlated (it is indeed a more realistic approach), so I'm totally disconcerted by this result.
> Can anyone explain what could be the reason?

  A few comments:

- most important: just because an effect is 'really' in the model (e.g.,
in this case, the effect of time really does vary among individuals)
doesn't mean it will have a statistically significant effect. In most
observational/complex fields (population biology, social sciences),
*all* of the effects are really non-zero. The purpose of significance
tests is to see which effects can be distinguished from noise.

- your explanation ("outcomes closer in time are more correlated") isn't
a very precise description of what the (obstime|ID) term in the model is
doing.  Your description is of an autoregressive model; the (obstime|ID)
model is a random-slope model (slopes with respect to time vary among
individuals).  You might want to check out the glmmTMB package for
autoregressive models ...
- glmmADMB's default correlation structure is diagonal, glmer.nb's is
unstructured; if you use (obstime||ID) in glmer.nb or 	corStruct="full"
in glmmadmb you should get more similar results (I would generally
recommend "full" as the default ...)
- likelihood ratio tests (which is what anova() is doing) generally give
conservative p-values when applied to random-effect variances (boundary
issues -- see http://tinyurl.com/glmmFAQ.html or Bolker (2009) or
Pinheiro and Bates 2000 for more discussion) -- so the p-values should
probably be approximately halved



More information about the R-sig-mixed-models mailing list