Learn R Programming

insight (version 0.6.0)

get_parameters: Get model parameters

Description

Returns the coefficients (or posterior samples for Bayesian models) from a model.

Usage

get_parameters(x, ...)

# S3 method for BBmm get_parameters(x, effects = c("fixed", "random"), ...)

# S3 method for glimML get_parameters(x, effects = c("fixed", "random", "all"), ...)

# S3 method for gam get_parameters(x, component = c("all", "conditional", "smooth_terms"), ...)

# S3 method for vgam get_parameters(x, component = c("all", "conditional", "smooth_terms"), ...)

# S3 method for rqss get_parameters(x, component = c("all", "conditional", "smooth_terms"), ...)

# S3 method for Gam get_parameters(x, component = c("all", "conditional", "smooth_terms"), ...)

# S3 method for zeroinfl get_parameters(x, component = c("all", "conditional", "zi", "zero_inflated"), ...)

# S3 method for gamm get_parameters(x, component = c("all", "conditional", "smooth_terms"), ...)

# S3 method for aovlist get_parameters(x, effects = c("fixed", "random", "all"), ...)

# S3 method for hurdle get_parameters(x, component = c("all", "conditional", "zi", "zero_inflated"), ...)

# S3 method for MCMCglmm get_parameters(x, effects = c("fixed", "random", "all"), ...)

# S3 method for coxme get_parameters(x, effects = c("fixed", "random"), ...)

# S3 method for merMod get_parameters(x, effects = c("fixed", "random"), ...)

# S3 method for rlmerMod get_parameters(x, effects = c("fixed", "random"), ...)

# S3 method for mixed get_parameters(x, effects = c("fixed", "random"), ...)

# S3 method for lme get_parameters(x, effects = c("fixed", "random"), ...)

# S3 method for MixMod get_parameters(x, effects = c("fixed", "random"), component = c("all", "conditional", "zi", "zero_inflated", "dispersion"), ...)

# S3 method for glmmTMB get_parameters(x, effects = c("fixed", "random"), component = c("all", "conditional", "zi", "zero_inflated", "dispersion"), ...)

# S3 method for brmsfit get_parameters(x, effects = c("fixed", "random", "all"), component = c("all", "conditional", "zi", "zero_inflated", "dispersion", "simplex", "sigma", "smooth_terms"), parameters = NULL, ...)

# S3 method for stanreg get_parameters(x, effects = c("fixed", "random", "all"), parameters = NULL, ...)

# S3 method for sim.merMod get_parameters(x, effects = c("fixed", "random", "all"), parameters = NULL, ...)

# S3 method for BFBayesFactor get_parameters(x, iterations = 4000, progress = FALSE, ...)

# S3 method for stanmvreg get_parameters(x, effects = c("fixed", "random", "all"), parameters = NULL, ...)

Arguments

x

A fitted model.

...

Currently not used.

effects

Should parameters for fixed effects, random effects or both be returned? Only applies to mixed models. May be abbreviated.

component

Should all parameters, parameters for the conditional model, the zero-inflated part of the model, the dispersion term or the instrumental variables be returned? Applies to models with zero-inflated and/or dispersion formula, or to models with instrumental variable (so called fixed-effects regressions). May be abbreviated.

parameters

Regular expression pattern that describes the parameters that should be returned.

iterations

Number of posterior draws.

progress

Display progress.

Value

  • for non-Bayesian models and if effects = "fixed", a data frame with two columns: the parameter names and the related point estimates

  • if effects = "random", a list of data frames with the random effects (as returned by ranef()), unless the random effects have the same simplified structure as fixed effects (e.g. for models from MCMCglmm)

  • for Bayesian models, the posterior samples from the requested parameters as data frame

  • for Anova (aov()) with error term, a list of parameters for the conditional and the random effects parameters

  • for models with smooth terms or zero-inflation component, a data frame with three columns: the parameter names, the related point estimates and the component

Details

In most cases when models either return different "effects" (fixed, random) or "components" (conditional, zero-inflated, ...), the arguments effects and component can be used.

get_parameters() is comparable to coef(), however, the coefficients are returned as data frame (with columns for names and point estimates of coefficients). For Bayesian models, the posterior samples of parameters are returned.

Examples

Run this code
# NOT RUN {
data(mtcars)
m <- lm(mpg ~ wt + cyl + vs, data = mtcars)
get_parameters(m)
# }

Run the code above in your browser using DataLab