Calculate Variance-Covariance Matrix for a Fitted Model Object
Returns the variance-covariance matrix of the main parameters of
a fitted model object. The “main” parameters of model
correspond to those returned by
coef, and typically do
not contain a nuisance scale parameter (
vcov(object, …) # S3 method for lm vcov(object, complete = TRUE, …) ## and also for '[summary.]glm' and 'mlm' # S3 method for aov vcov(object, complete = FALSE, …)
.vcov.aliased(aliased, vc, complete = TRUE)
a fitted model object, typically. Sometimes also a
summary()object of such a fitted model.
mlm, and where applicable
summary.lmetc methods: logical indicating if the full variance-covariance matrix should be returned also in case of an over-determined system where some coefficients are undefined and
NAs correspondingly. When
complete = TRUE,
vcov()is compatible with
coef()also in this singular case.
additional arguments for method functions. For the
glmmethod this can be used to pass a
logicalvector typically identical to
is.na(coef(.))indicating which coefficients are ‘aliased’.
a variance-covariance matrix, typically “incomplete”, i.e., with no rows and columns for aliased coefficients.
vcov() is a generic function and functions with names beginning
vcov. will be methods for this function.
Classes with methods for this function include:
rlm (in package MASS),
multinom (in package nnet)
lme (in package nlme),
survreg (in package survival).
vcov() methods for summary objects allow more
efficient and still encapsulated access when both
vcov(mod) are needed.)
.vcov.aliased() is an auxiliary function useful for
vcov method implementations which have to deal with singular
model fits encoded via NA coefficients: It augments a vcov--matrix
NA rows and columns where needed, i.e., when
some entries of
aliased are true and
vc is of smaller dimension
A matrix of the estimated covariances between the parameter estimates
in the linear or non-linear predictor of the model. This should have
row and column names corresponding to the parameter names given by the
When some coefficients of the (linear) model are undetermined and
NA because of linearly dependent terms (or an
“over specified” model), also called
alias, then since R version 3.5.0,
complete = TRUE, i.e., by default for
lm etc, but not for
aov) contains corresponding rows and
coef() has always