information2 | R Documentation |
Extract the expected information matrix from a latent variable model.
Similar to lava::information
but with small sample correction.
information2(object, as.lava, ssc, ...)
## S3 method for class 'lvmfit'
information2(object, as.lava = TRUE, ssc = lava.options()$ssc, ...)
## S3 method for class 'lvmfit2'
information2(object, as.lava = TRUE, ...)
## S3 method for class 'lvmfit2'
information(x, ...)
object , x |
a |
as.lava |
[logical] if |
ssc |
[character] method used to correct the small sample bias of the variance coefficients: no correction ( |
... |
additional argument passed to |
When argument object is a lvmfit
object, the method first calls estimate2
and then extract the information matrix.
A matrix with as many rows and columns as the number of coefficients.
estimate2
to obtain lvmfit2
objects.
#### simulate data ####
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 models ####
e.lm <- lm(formula.lvm,data=d)
#### latent variable models ####
e.lvm <- estimate(lvm(formula.lvm),data=d)
information(e.lvm)
information2(e.lvm)
information2(e.lvm)[1:4,1:4] - solve(vcov(e.lm))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.