probe2WayMC(fit, nameX, nameY, modVar, valProbe)
valProbe
indProd
function. The indicator products can be made for all possible combination or matched-pair approach (Marsh et al., 2004). Next, the hypothesized model with the regression with latent interaction will be used to fit all original indicators and the product terms. See the example for how to fit the product term below. Once the lavaan result is obtained, this function will be used to probe the interaction.
Let that the latent interaction model regressing the dependent variable ($Y$) on the independent varaible ($X$) and the moderator ($Z$) be
$$Y = b_0 + b_1X + b_2Z + b_3XZ + r,$$
where $b_0$ is the estimated intercept or the expected value of $Y$ when both $X$ and $Z$ are 0, $b_1$ is the effect of $X$ when $Z$ is 0, $b_2$ is the effect of $Z$ when $X$ is 0, $b_3$ is the interaction effect between $X$ and $Z$, and $r$ is the residual term.
For probing two-way interaction, the simple intercept of the independent variable at each value of the moderator (Aiken & West, 1991; Cohen, Cohen, West, & Aiken, 2003; Preacher, Curran, & Bauer, 2006) can be obtained by
$$b_{0|X = 0, Z} = b_0 + b_2Z.$$
The simple slope of the independent varaible at each value of the moderator can be obtained by
$$b_{X|Z} = b_1 + b_3Z.$$
The variance of the simple intercept formula is
$$Var\left(b_{0|X = 0, Z}\right) = Var\left(b_0\right) + 2ZCov\left(b_0, b_2\right) + Z^2Var\left(b_2\right)$$
where $Var$ denotes the variance of a parameter estimate and $Cov$ denotes the covariance of two parameter estimates.
The variance of the simple slope formula is
$$Var\left(b_{X|Z}\right) = Var\left(b_1\right) + 2ZCov\left(b_1, b_3\right) + Z^2Var\left(b_3\right)$$
Wald statistic is used for test statistic.indProd
For creating the indicator products with no centering, mean centering, double-mean centering, or residual centering.probe3WayMC
For probing the three-way latent interaction when the results are obtained from mean-centering, or double-mean centering.probe2WayRC
For probing the two-way latent interaction when the results are obtained from residual-centering approach.probe3WayRC
For probing the two-way latent interaction when the results are obtained from residual-centering approach.plotProbe
Plot the simple intercepts and slopes of the latent interaction.library(lavaan)
dat2wayMC <- indProd(dat2way, 1:3, 4:6)
model1 <- "f1 =~ x1 + x2 + x3
f2 =~ x4 + x5 + x6
f12 =~ x1.x4 + x2.x5 + x3.x6
f3 =~ x7 + x8 + x9
f3 ~ f1 + f2 + f12
f12 ~~0*f1
f12 ~~ 0*f2
x1 ~ 0*1
x4 ~ 0*1
x1.x4 ~ 0*1
x7 ~ 0*1
f1 ~ NA*1
f2 ~ NA*1
f12 ~ NA*1
f3 ~ NA*1
"
fitMC2way <- sem(model1, data=dat2wayMC, meanstructure=TRUE, std.lv=FALSE)
summary(fitMC2way)
result2wayMC <- probe2WayMC(fitMC2way, c("f1", "f2", "f12"), "f3", "f2", c(-1, 0, 1))
result2wayMC
Run the code above in your browser using DataLab