if (FALSE) {
# mediation model
B <- matrix(c(
c(.00, .00, .00),
c(.10, .00, .00),
c(.20, .30, .00)
), byrow = TRUE, ncol = 3)
Psi <- getPsi.B(B)
# CLPM with residual correlations
B <- matrix(c(
c(.00, .00, .00, .00),
c(.30, .00, .00, .00),
c(.70, .10, .00, .00),
c(.20, .70, .00, .00)
), byrow = TRUE, ncol = 4)
sPsi <- matrix(c(
c(1, .00, .00, .00),
c(.00, 1, .00, .00),
c(.00, .00, 1, .30),
c(.00, .00, .30, 1)
), byrow = TRUE, ncol = 4)
# so that residual cor is std
Psi <- getPsi.B(B, sPsi, standResCov = TRUE)
# so that residual cor is unsstd
Psi <- getPsi.B(B, sPsi, standResCov = FALSE)
}
Run the code above in your browser using DataLab