library(modsem)
m1 <- '
# Outer Model
X =~ x1 + x2 +x3
Y =~ y1 + y2 + y3
Z =~ z1 + z2 + z3
# Inner model
Y ~ X + Z + X:Z
'
est_dblcent <- twostep(m1, oneInt, method = "dblcent")
summary(est_dblcent)
if (FALSE) {
est_lms <- twostep(m1, oneInt, method = "lms")
summary(est_lms)
est_qml <- twostep(m1, oneInt, method = "qml")
summary(est_qml)
}
tpb_uk <- "
# Outer Model (Based on Hagger et al., 2007)
ATT =~ att1 + att2 + att3 + att4 + att5
SN =~ sn1 + sn2 + sn3
PBC =~ pbc1 + pbc2 + pbc3 + pbc4
INT =~ int1 + int2 + int3 + int4
BEH =~ beh1 + beh2 + beh3
# Inner Model (Based on Steinmetz et al., 2011)
# Causal Relationsships
INT ~ ATT + SN + PBC
BEH ~ INT + PBC
BEH ~ INT:PBC
"
uk_dblcent <- twostep(tpb_uk, TPB_UK, method = "dblcent")
summary(uk_dblcent)
if (FALSE) {
uk_qml <- twostep(tpb_uk, TPB_UK, method = "qml")
uk_lms <- twostep(tpb_uk, TPB_UK, method = "lms", nodes = 32, adaptive.quad = TRUE)
summary(uk_lms)
}
Run the code above in your browser using DataLab