Skip to content
Prev 17134 / 20628 Next

post hoc tests for glmmTMB

The point about Wald tests is correct, although their reliability
depends very much on context (they should be pretty good for tests of
fixed effects when the data set is reasonably large and predicted
probabilities/counts are not too extreme, i.e. not too close to zero
(counts) or 0/1 (probabilities)).

  There are a lot of improvements in the development version with
respect to post hoc tests etc. on glmmTMB fits, as documented here:
<https://github.com/glmmTMB/glmmTMB/blob/master/glmmTMB/vignettes/model_evaluation.rmd>

  If you can install the development version (see
https://github.com/glmmTMB/glmmTMB/blob/master/README.md), that should
help a lot.

 If you can't, most of these improvements will probably get to CRAN in
the next week or two; we're planning a new release soon.

  In any case, I think that running the following code should make
multcomp work with glmmTMB objects (not quite sure what that first
function is doing ... ???)

glht_glmmTMB <- function (model, ..., component="cond") {
    glht(model, ...,
         coef. = function(x) fixef(x)[[component]],
         vcov. = function(x) vcov(x)[[component]],
         df = NULL)
}
modelparm.glmmTMB <- function (model, coef. = function(x)
fixef(x)[[component]],
                               vcov. = function(x) vcov(x)[[component]],
                               df = NULL, component="cond", ...) {
    multcomp:::modelparm.default(model, coef. = coef., vcov. = vcov.,
                        df = df, ...)
}

## example
g1 <- glht(cbpp_b1, linfct = mcp(period = "Tukey"))
On 2018-11-09 9:42 a.m., Guillaume Adeux wrote: