Skip to content
Prev 14569 / 20628 Next

problem extracting main effects from an updated glmm

Thanks for presenting a clear reproducible example.

 Depending on exactly what you need, there are other ways to "extract
the main effects"  (e.g. fixef(fitted_model),
coef(summary(fitted_model)), broom::tidy(fitted_model),
dotwhisker::dwplot(fitted_model)), but I can appreciate the convenience
of the effects package.

  The effects package is having trouble because one of its internal
functions is trying to call glm() with the arguments previously provided
to glmer, and the format of the 'start' parameter for glmer() is
inconsistent with the one glm() is expecting (the

  Here's a crude way to hack the effects package so that it will work ...

## dump the text of the offending function to a file
cat(deparse(effects:::mer.to.glm,width.cutoff=200),
    file="mer.to.glm.R",sep="\n")
## NOW EDIT THE FILE IN AN EXTERNAL TEXT EDITOR:
## (1) add "mer.to.glm <-" at the top
## (2) edit line 32; remove  "start", from argument list to be matched
## (3) l. 35, change fixmod -> effects:::fixmod
## read the file back in
source("mer.to.glm.R")
## shove it back into the package namespace
assignInNamespace("mer.to.glm",mer.to.glm,"effects")
effects:::mer.to.glm ## print the function to check that it worked

  Having done that, allEffects(M2) works.

  This should be pretty easily fixable in the next release of the
effects package, so you wouldn't have to do the hacking any more.

  cheers
    Ben Bolker
On 16-06-07 01:31 PM, Mariano Devoto wrote: