View source: R/get_auxiliary.R
| get_auxiliary | R Documentation |
Returns the requested auxiliary parameters from models, like dispersion, sigma, or beta...
get_auxiliary(
x,
type = "sigma",
summary = TRUE,
centrality = "mean",
verbose = TRUE,
...
)
get_dispersion(x, ...)
## Default S3 method:
get_dispersion(x, ...)
x |
A model. |
type |
The name of the auxiliary parameter that should be retrieved.
|
summary |
Logical, indicates whether the full posterior samples
( |
centrality |
Only for models with posterior samples, and when
|
verbose |
Toggle warnings. |
... |
Currently not used. |
Currently, only sigma and the dispersion parameter are returned, and only for a limited set of models.
The requested auxiliary parameter, or NULL if this information
could not be accessed.
See get_sigma().
There are many different definitions of "dispersion", depending on the context.
get_auxiliary() returns the dispersion parameters that usually can
be considered as variance-to-mean ratio for generalized (linear) mixed
models. Exceptions are models of class glmmTMB, where the dispersion
equals σ2.
In detail, the computation of the dispersion parameter for generalized linear
models is the ratio of the sum of the squared working-residuals and the
residual degrees of freedom. For mixed models of class glmer, the
dispersion parameter is also called φ
and is the ratio of the sum of the squared Pearson-residuals and the residual
degrees of freedom. For models of class glmmTMB, dispersion is
σ2.
For models of class brmsfit, there are different options for the
type argument. See a list of supported auxiliary parameters here:
find_parameters.BGGM().
# from ?glm
clotting <- data.frame(
u = c(5, 10, 15, 20, 30, 40, 60, 80, 100),
lot1 = c(118, 58, 42, 35, 27, 25, 21, 19, 18),
lot2 = c(69, 35, 26, 21, 18, 16, 13, 12, 12)
)
model <- glm(lot1 ~ log(u), data = clotting, family = Gamma())
get_auxiliary(model, type = "dispersion") # same as summary(model)$dispersion
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.