coef2 {lavaSearch2} | R Documentation |
Model Coefficients With Small Sample Correction
Description
Extract the coefficients from a latent variable model.
Similar to lava::compare
but with small sample correction.
Usage
coef2(object, as.lava, ...)
## S3 method for class 'lvmfit'
coef2(object, as.lava = TRUE, ssc = lava.options()$ssc, ...)
Arguments
object |
a |
as.lava |
[logical] if |
... |
additional argument passed to |
ssc |
[character] method used to correct the small sample bias of the variance coefficients: no correction ( |
Details
When argument object is a lvmfit
object, the method first calls estimate2
and then extract the model coefficients.
Value
A numeric vector named with the names of the coefficients.
See Also
estimate2
to obtain lvmfit2
objects.
Examples
#### simulate data ####
set.seed(10)
dW <- sampleRepeated(10, format = "wide")
set.seed(10)
dL <- sampleRepeated(10, format = "long")
dL$time2 <- paste0("visit",dL$time)
#### latent variable models ####
e.lvm <- estimate(lvm(c(Y1,Y2,Y3) ~ 1*eta + X1, eta ~ Z1), data = dW)
coef(e.lvm)
coef2(e.lvm)
coef2(e.lvm, as.lava = FALSE)