Retrieve information from model objects.
model_info(x, ...) # S3 method for default model_info(x, verbose = TRUE, ...)
| x | A fitted model. |
|---|---|
| ... | Currently not used. |
| verbose | Toggle off warnings. |
A list with information about the model, like family, link-function etc. (see 'Details').
model_info() returns a list with information about the
model for many different model objects. Following information
is returned, where all values starting with is_ are logicals.
is_binomial: family is binomial (but not negative binomial)
is_poisson: family is poisson
is_negbin: family is negative binomial
is_count: model is a count model (i.e. family is either poisson or negative binomial)
is_beta: family is beta
is_betabinomial: family is beta-binomial
is_dirichlet: family is dirichlet
is_exponential: family is exponential (e.g. Gamma or Weibull)
is_logit: model has logit link
is_probit: model has probit link
is_linear: family is gaussian
is_tweedie: family is tweedie
is_ordinal: family is ordinal or cumulative link
is_cumulative: family is ordinal or cumulative link
is_multinomial: family is multinomial or categorical link
is_categorical: family is categorical link
is_censored: model is a censored model (has a censored response, including survival models)
is_truncated: model is a truncated model (has a truncated response)
is_survival: model is a survival model
is_zero_inflated: model has zero-inflation component
is_hurdle: model has zero-inflation component and is a hurdle-model (truncated family distribution)
is_dispersion: model has dispersion component
is_mixed: model is a mixed effects model (with random effects)
is_multivariate: model is a multivariate response model (currently only works for brmsfit objects)
is_trial: model response contains additional information about the trials
is_bayesian: model is a Bayesian model
is_anova: model is an Anova object
link_function: the link-function
family: the family-object
n_obs: number of observations
model_terms: a list with all model terms, including terms such as random effects or from zero-inflated model parts.
ldose <- rep(0:5, 2) numdead <- c(1, 4, 9, 13, 18, 20, 0, 2, 6, 10, 12, 16) sex <- factor(rep(c("M", "F"), c(6, 6))) SF <- cbind(numdead, numalive = 20 - numdead) dat <- data.frame(ldose, sex, SF, stringsAsFactors = FALSE) m <- glm(SF ~ sex * ldose, family = binomial) model_info(m)#> $is_binomial #> [1] TRUE #> #> $is_count #> [1] FALSE #> #> $is_poisson #> [1] FALSE #> #> $is_negbin #> [1] FALSE #> #> $is_beta #> [1] FALSE #> #> $is_betabinomial #> [1] FALSE #> #> $is_dirichlet #> [1] FALSE #> #> $is_exponential #> [1] FALSE #> #> $is_logit #> [1] TRUE #> #> $is_probit #> [1] FALSE #> #> $is_censored #> [1] FALSE #> #> $is_truncated #> [1] FALSE #> #> $is_survival #> [1] FALSE #> #> $is_linear #> [1] FALSE #> #> $is_tweedie #> [1] FALSE #> #> $is_zeroinf #> [1] FALSE #> #> $is_zero_inflated #> [1] FALSE #> #> $is_dispersion #> [1] FALSE #> #> $is_hurdle #> [1] FALSE #> #> $is_ordinal #> [1] FALSE #> #> $is_cumulative #> [1] FALSE #> #> $is_multinomial #> [1] FALSE #> #> $is_categorical #> [1] FALSE #> #> $is_mixed #> [1] FALSE #> #> $is_multivariate #> [1] FALSE #> #> $is_trial #> [1] FALSE #> #> $is_bayesian #> [1] FALSE #> #> $is_anova #> [1] FALSE #> #> $is_timeseries #> [1] FALSE #> #> $is_ttest #> [1] FALSE #> #> $is_correlation #> [1] FALSE #> #> $is_meta #> [1] FALSE #> #> $link_function #> [1] "logit" #> #> $family #> [1] "binomial" #> #> $n_obs #> [1] 12 #> #> $model_terms #> $model_terms$response #> [1] "SF" #> #> $model_terms$conditional #> [1] "sex" "ldose" #> #>if (FALSE) { library(glmmTMB) data("Salamanders") m <- glmmTMB( count ~ spp + cover + mined + (1 | site), ziformula = ~ spp + mined, dispformula = ~DOY, data = Salamanders, family = nbinom2 ) } model_info(m)#> $is_binomial #> [1] TRUE #> #> $is_count #> [1] FALSE #> #> $is_poisson #> [1] FALSE #> #> $is_negbin #> [1] FALSE #> #> $is_beta #> [1] FALSE #> #> $is_betabinomial #> [1] FALSE #> #> $is_dirichlet #> [1] FALSE #> #> $is_exponential #> [1] FALSE #> #> $is_logit #> [1] TRUE #> #> $is_probit #> [1] FALSE #> #> $is_censored #> [1] FALSE #> #> $is_truncated #> [1] FALSE #> #> $is_survival #> [1] FALSE #> #> $is_linear #> [1] FALSE #> #> $is_tweedie #> [1] FALSE #> #> $is_zeroinf #> [1] FALSE #> #> $is_zero_inflated #> [1] FALSE #> #> $is_dispersion #> [1] FALSE #> #> $is_hurdle #> [1] FALSE #> #> $is_ordinal #> [1] FALSE #> #> $is_cumulative #> [1] FALSE #> #> $is_multinomial #> [1] FALSE #> #> $is_categorical #> [1] FALSE #> #> $is_mixed #> [1] FALSE #> #> $is_multivariate #> [1] FALSE #> #> $is_trial #> [1] FALSE #> #> $is_bayesian #> [1] FALSE #> #> $is_anova #> [1] FALSE #> #> $is_timeseries #> [1] FALSE #> #> $is_ttest #> [1] FALSE #> #> $is_correlation #> [1] FALSE #> #> $is_meta #> [1] FALSE #> #> $link_function #> [1] "logit" #> #> $family #> [1] "binomial" #> #> $n_obs #> [1] 12 #> #> $model_terms #> $model_terms$response #> [1] "SF" #> #> $model_terms$conditional #> [1] "sex" "ldose" #> #>