1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods.R
\name{residuals.glmmTMB}
\alias{residuals.glmmTMB}
\alias{deviance.glmmTMB}
\title{Compute residuals for a glmmTMB object}
\usage{
\method{residuals}{glmmTMB}(
object,
type = c("response", "pearson", "working", "deviance", "dunn-smyth"),
re.form = NULL,
...
)
\method{deviance}{glmmTMB}(object, ...)
}
\arguments{
\item{object}{a \dQuote{glmmTMB} object}
\item{type}{(character) residual type}
\item{re.form}{\code{NULL} to specify individual-level predictions; \code{~0} or \code{NA} to specify population-level predictions (i.e., setting all random effects to zero)}
\item{\dots}{for method compatibility (unused arguments will throw an error)}
}
\description{
Compute residuals for a glmmTMB object
}
\details{
\itemize{
\item Residuals are computed based on predictions of type "response",
i.e. equal to the conditional mean for non-zero-inflated models and to \code{mu*(1-p)}
for zero-inflated models
\item Computing deviance residuals depends on the implementation of the \code{dev.resids}
function from the object's \code{family} component; at present this returns \code{NA} for most
"exotic" families (i.e. deviance residuals are currently only
implemented for families built into base R plus \code{nbinom1}, \code{nbinom2}). Deviance residuals are based on the conditional distributions only, i.e. ignoring zero-inflation components.
\item Deviance is computed as the sum of squared deviance residuals, so is available only
for the families listed in the bullet point above. See \link[lme4]{deviance.merMod} for more
details on the definition of the deviance for GLMMs.
}
}
|