Skip to content
Prev 18249 / 20628 Next

Error from glmmTMB().

Wow.  This is impressive, and fascinating, albeit somewhat mystifying.

I tried your code and yes indeed it runs without complaint; no errors, 
no warnings.

I conclude from this that mixed_model() is capable of fitting models 
using the beta binomial distribution, a fact of which I was previously 
unaware.  (I previously thought that only the glmmTMB package provided 
this capability.)

I gather, after reading TFM a bit more, that mixed_model() can 
accommodate custom-built family functions, such as the beta.binomial()
function that you used to produce a fit to my example.

However writing such custom-built family functions is a bit beyond my
very limited capabilities.

I am currently struggling to find suitable models to fit to a number of
rather recalcitrant data sets.  The model presented in my question to
r-sig-mixed-models was just one of a fairly large number with which I 
would like to experiment.  The data in question appear to exhibit 
over-dispersion w.r.t. the binomial distribution.  The random effects 
models that I am fitting seem to produce problematic results; I want to 
try using the beta binomial distribution in addition to (or perhaps 
instead of) random effects modelling.

With glmmTMB() I can (with *some* data sets) fit models like

     glmmTMB(cbind(Dead, Alive) ~ (Trt + 0)/Dose + (Dose | Rep),
             data = X, family = betabinomial(link = "cloglog"),
                dispformula = ~Dose)

I can also set dispformula equal to ~poly(Dose,2) or ~splines::ns(Dose,2).

Can custom-built family functions be created to do this sort of thing 
using mixed_model()?

If so, what would the appropriate value of n_phis be?  I am *guessing* 
that for dispformula = ~Dose, n_phis would be set equal to 2, and for
dispformula = ~poly(Dose,2) it would be 3.  What about for
dispformula = ~splines::ns(Dose,2) ?

Also (sorry for going on!) with glmmTMB() there is the possibility of
omitting random effects entirely and just trying to accommodate 
over-dispersion by means of the beta binomial distribution:

glmmTMB(cbind(Dead, Alive) ~ (Trt + 0)/Dose,data = X,
        family = betabinomial(link = "cloglog"),
                dispformula = ~Dose)

Omitting random effects does not seem to be possible with mixed_model().
Is that correct?  Or have I simply not been using the right syntax?

Thanks for any words of wisdom that you can spare me.

cheers,

Rolf
On 19/03/20 10:03 am, D. Rizopoulos wrote: