insight (version 0.11.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 DirichletRegModel get_varcov(x, component = c("conditional", "precision", "all"), ...)

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

# 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 zcpglm 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", "dispersion", "all"), ... )

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

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

# S3 method for aov get_varcov(x, complete = FALSE, ...)

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

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", "dispersion", "precision", or "all". May be abbreviated. Note that the conditional component is also called count or mean component, depending on the model.

complete

Logical, if TRUE, for aov, returns the full variance-covariance matrix.

effects

Should the complete variance-covariance matrix of the model be returned, or only for specific model parameters only? Currently only applies to models of class mixor.

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