Learn R Programming

lavaSearch2 (version 1.5.6)

information2: Extract The full Information Matrix

Description

Extract the full information matrix from a Gaussian linear model.

Usage

information2(object, ...)

# S3 method for lm information2(object, ...)

# S3 method for gls information2(object, ...)

# S3 method for lme information2(object, ...)

# S3 method for lvmfit information2(object, ...)

# S3 method for lm2 information2(object, ...)

# S3 method for gls2 information2(object, ...)

# S3 method for lme2 information2(object, ...)

# S3 method for lvmfit2 information2(object, ...)

Value

A matrix.

Arguments

object

a linear model or a latent variable model

...

arguments to be passed to vcov2.

See Also

sCorrect to obtain lm2, gls2, lme2, or lvmfit2 objects.

Examples

Run this code
n <- 5e1
p <- 3
X.name <- paste0("X",1:p)
link.lvm <- paste0("Y~",X.name)
formula.lvm <- as.formula(paste0("Y~",paste0(X.name,collapse="+")))

m <- lvm(formula.lvm)
distribution(m,~Id) <- Sequence.lvm(0)
set.seed(10)
d <- lava::sim(m,n)

## linear model
e.lm <- lm(formula.lvm,data=d)
info.tempo <- vcov2(e.lm, bias.correct = TRUE)
info.tempo[names(coef(e.lm)),names(coef(e.lm))] - vcov(e.lm)

## latent variable model
e.lvm <- estimate(lvm(formula.lvm),data=d)
vcov.tempo <- vcov2(e.lvm, bias.correct = FALSE)
round(vcov.tempo %*% information(e.lvm), 5)

Run the code above in your browser using DataLab