# Theory Of Planned Behavior
m1 <- '
# Outer Model
X =~ x1 + x2
Z =~ z1 + z2
Y =~ y1 + y2
# Inner model
Y ~ X + Z + X:Z
'
if (FALSE) {
# Check if Mplus is installed
run <- tryCatch({MplusAutomation::detectMplus(); TRUE},
error = \(e) FALSE)
if (run) {
est_mplus <- modsem_mplus(m1, data = oneInt)
summary(est_mplus)
}
}
Run the code above in your browser using DataLab