Learn R Programming

insight (version 0.6.0)

get_varcov: Get variance-covariance matrix from models

Description

Returns the variance-covariance, as retrieved by stats::vcov(), but works for more model objects that probably don't provide a vcov()-method.

Usage

get_varcov(x, ...)

# S3 method for betareg get_varcov(x, component = c("conditional", "precision", "all"), ...)

# S3 method for truncreg get_varcov(x, component = c("conditional", "all"), ...)

# S3 method for gamlss get_varcov(x, component = c("conditional", "all"), ...)

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

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

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

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

Arguments

x

A model.

...

Currently not used.

component

Should the complete variance-covariance matrix of the model be returned, or only for specific model components only (like count or zero-inflated model parts)? Applies to models with zero-inflated component, or models with precision (e.g. betareg) component. component may be one of "conditional", "zi", "zero-inflated", "precision", or "all". May be abbreviated.

Value

The variance-covariance matrix, as matrix-object.

Examples

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

Run the code above in your browser using DataLab