mirror_vcov: Create a properly symmetric variance covariance matrix

View source: R/utilities.R

mirror_vcovR Documentation

Create a properly symmetric variance covariance matrix

Description

A wrapper on vcov to produce a symmetric matrix. If the default matrix returned by vcov is symmetric it is returned simply. If it is not, in fact, symmetric (as occurs occasionally with multinom applied to proportions), the matrix is made symmetric by averaging the lower and upper triangles. If the relative difference between the upper and lower triangles for any entry is more than 0.1

Usage

mirror_vcov(x)

Arguments

x

Model object that has a defined method for vcov.

Value

Properly symmetric variance covariance matrix.

Examples

  dat <- data.frame(y = rnorm(50), x = rnorm(50))
  mod <- lm(dat)
  mirror_vcov(mod)


LDATS documentation built on Sept. 19, 2023, 5:08 p.m.