Get variance-covariance matrix from models
Returns the variance-covariance, as retrieved by
stats::vcov()
, but works for more model objects that probably
don't provide a vcov()
-method.
get_varcov(x, ...) ## Default S3 method: get_varcov(x, verbose = TRUE, ...) ## S3 method for class 'betareg' get_varcov( x, component = c("conditional", "precision", "all"), verbose = TRUE, ... ) ## S3 method for class 'DirichletRegModel' get_varcov( x, component = c("conditional", "precision", "all"), verbose = TRUE, ... ) ## S3 method for class 'clm2' get_varcov(x, component = c("all", "conditional", "scale"), ...) ## S3 method for class 'truncreg' get_varcov(x, component = c("conditional", "all"), ...) ## S3 method for class 'gamlss' get_varcov(x, component = c("conditional", "all"), ...) ## S3 method for class 'hurdle' get_varcov(x, component = c("conditional", "zero_inflated", "zi", "all"), ...) ## S3 method for class 'zcpglm' get_varcov(x, component = c("conditional", "zero_inflated", "zi", "all"), ...) ## S3 method for class 'MixMod' get_varcov(x, component = c("conditional", "zero_inflated", "zi", "all"), ...) ## S3 method for class 'glmmTMB' get_varcov( x, component = c("conditional", "zero_inflated", "zi", "dispersion", "all"), ... ) ## S3 method for class 'brmsfit' get_varcov(x, component = "conditional", ...) ## S3 method for class 'betamfx' get_varcov(x, component = c("conditional", "precision", "all"), ...) ## S3 method for class 'aov' get_varcov(x, complete = FALSE, ...) ## S3 method for class 'mixor' get_varcov(x, effects = c("all", "fixed", "random"), ...)
x |
A model. |
... |
Currently not used. |
verbose |
Toggle warnings. |
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. |
complete |
Logical, if |
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 |
The variance-covariance matrix, as matrix
-object.
get_varcov()
tries to return the nearest positive definite matrix
in case of a negative variance-covariance matrix.
data(mtcars) m <- lm(mpg ~ wt + cyl + vs, data = mtcars) get_varcov(m)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.