mirror_vcov: Create a properly symmetric variance covariance matrix

Description Usage Arguments Value Examples

View source: R/utilities.R

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

1

Arguments

x

Model object that has a defined method for vcov.

Value

Properly symmetric variance covariance matrix.

Examples

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

weecology/LDATS documentation built on March 28, 2020, 11:20 a.m.