I am working with lavaan to conduct a latent variable analysis. I have a sequence of 5 indicators for a single latent variable. This is subsequently used in an structural equation model to inspect relations among several exogenous variables. To assess the results and my intuition for the SEM results, I want to look at using predicted values for the latent variable as an exogenous variable in a path model.
I had assumed that the data matrix could be multiplied with the factor loadings to produce such a scale. However, using the predict method for lavaan signatures, I see this to not necessarily be the case. It seems that predictions are scaled by the residual variance of the indicators. But even doing this, I see that my verifications are slightly off from the lavaan model.
An example dataset follows:
set.seed(123) nparm <- 5 nobs <- 200 Xmat <- (trueX <- rnorm(nobs, 0, (latvar <- rnorm(1)^2))) %o% (loads <- rnorm(nparm)) + sweep(matrix(rnorm(nobs*nparm), nobs, nparm), 2, resvars <- rnorm(nparm)^2) Xdat <- as.data.frame(Xmat) colnames(Xdat) <- letters[1:nparm] library(lavaan) Cfa <- cfa('X =~ a + b + c + d + e', data=Xdat) pred1 <- predict(Cfa) estparms <- Cfa@Model@GLIST pred2 <- scale(Xmat %*% solve(estparms$theta) %*% estparms$lambda, center=T, scale=F)
I find that my method produces collinear predictions with the actual latent variable, but they are off by a scale value. How does one use the model parameters to construct predicted values from a latent variable analysis?