[R-sig-ME] degrees of freedom in Gamma GLMMs

Henrik Singmann singmann at psychologie.uzh.ch
Mon Feb 19 11:27:00 CET 2018


Hi Jana,

If you want degrees of freedom, you could use package afex which allows 
you to calculate likelihood-ratio tests for the fixed effects. This way 
you can simply report chi-square tests with df equal to the number of 
omitted parameters for each test. For example:

library("afex")
data("fhch2010") # load Freeman, Heathcote, Chalmers, and Hockley (2010) 
data
fhch <- droplevels(fhch2010[ fhch2010$correct,]) # remove errors

m1s <- mixed(rt ~ task*stimulus + (stimulus|id) + (task|item),
              fhch, method = "LRT", family = Gamma(link = "identity"))
m1s
# Mixed Model Anova Table (Type 3 tests, LRT-method)
#
# Model: rt ~ task * stimulus + (stimulus | id) + (task | item)
# Data: fhch
# Df full model: 11
#          Effect df     Chisq p.value
# 1          task  1 14.43 ***   .0001
# 2      stimulus  1 28.37 ***  <.0001
# 3 task:stimulus  1 12.11 ***   .0005
# ---
# Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘+’ 0.1 ‘ ’ 1
(For simplicity I have omitted convergence warnings from the output.)

Note that the values of the test statistics reported can be different 
from the ones reported by glmer directly, because they are based on 
comparing a full model against a reduced model in which each effect is 
omitted. However, models are also estimated with lme4::glmer.

I would report the main effect of task as: chi^2(1) = 14.43, p = .0001 
(replace chi with the greek symbol and ^2 with power of two).

Hope that helps,
Henrik


Am 19.02.2018 um 10:25 schrieb Klaus, J. (Jana):
> Hi all,
> 
>   
> 
> I have fitted a GLMM with a Gamma distribution with crossed random effects in lme4 for reaction times, like this:
> 
>   
> 
> model = glmer(RT~Factor1*Factor2+ (1+Factor1+Factor2|subj) + (1+Factor1|item), data=xdat, family = Gamma(link = "identity"), control=glmerControl(optimizer = "bobyqa"))
> 
>   
> 
> The editor now insists on reporting degrees of freedom. From what I have found online, this is not trivial, and potentially not at all possible with the design. I fit the same model with glmmPQL but I cannot reproduce the results, presumably because the random effects are treated as nested rather than crossed there. Also, as far as I can tell, all other workarounds to compute dfs do not apply to this specific design. Nevertheless, I’m afraid I might be overlooking something essential already implemented in lme4 (or any other package for that matter). If this is not the case, could you point me towards any work that explains *why* it can’t be done for GLMMs? Any help is greatly appreciated!
> 
>   
> 
> Cheers,
> 
> Jana
> 
> 
> 	[[alternative HTML version deleted]]
>



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