extract.covmat {simex}R Documentation

Extracts the covariance matrix

Description

Extracts the covariance matrix from various models and returns them in a way, so that the simex and mcsimex functions can use them.

Usage

extract.covmat(model)

Arguments

model object of a fitting function

Details

So far objects of class lm, glm, gam, nls, lme, nlme are supported.

Value

covmat covariance matrix of the supplied model

Note

Easily extendable for other objects. Is required for jackknife variance estimation.

This function is for internal use only!

Author(s)

Wolfgang Lederer

See Also

simex,mcsimex

Examples

x <- rnorm(100,0,100)
u <- rnorm(100,0,25)
w <- x+u
y <- x +rnorm(100,0,9)
model <- lm(y~w, x = TRUE, y =TRUE)
extract.covmat(model)
summary(model)$cov.unscaled*summary(model)$sigma^2

[Package simex version 1.2 Index]