if (FALSE) {
#### A mediation model
model1 <- "y ~ c*x + b*m
m ~ a*x
## Means
y ~ b0*1
m ~ m0*1
x ~ x0*1"
RAM1 <- metaSEM::lavaan2RAM(model1)
## Model-implied covariance matrix and mean structure
JacobianRAM(RAM1, corr=FALSE)
## Model-implied correlation matrix
JacobianRAM(RAM1, corr=TRUE)
#### A CFA model
model2 <- "f =~ x1 + x2 + x3 + x4#'
## Mean
f ~ fmean*1"
RAM2 <- metaSEM::lavaan2RAM(model2)
## Model-implied covariance matrix
JacobianRAM(RAM2, corr=FALSE)
## Model-implied correlation matrix
JacobianRAM(RAM2, corr=TRUE)
}
Run the code above in your browser using DataLab