Compute interaction indicators for tspa() function
get_fs_int.Rd
This function computes product indicators and the corresponding standard errors according to equation (3) in Hsiao et al. (2021). The double-mean-centering (DMC) strategy is applied in this function, where first-order indicators are mean-centered first and product indicators for latent interaction term(s) are mean-centered again (Lin et al., 2010)
Arguments
- dat
A data frame containing first-order factor score indiactors with standard error.
- fs_name
A vector indicating names of factor scores
- se_fs
A vector indicating standard error of factor scores
- loading_fs
A vector indicating model-implied loadings of factor scores
- lat_var
A vector indicating latent variances
- model
An optional string specifying the measurement model in
lavaan
syntax.
Value
A data frame of product indicators for interaction terms, with their loadings and standard errors.
References
Hsiao, Y.-Y., Kwok, O.-M., & Lai, M. H. C. (2021). Modeling measurement errors of the exogenous composites from congeneric measures in interaction models. Structural Equation Modeling: A Multidisciplinary Journal, 28(2), 250–260. https://doi.org/10.1080/10705511.2020.1782206
Examples
library(lavaan)
fs1 <- get_fs(HolzingerSwineford1939,
model = "visual =~ x1 + x2 + x3",
std.lv = TRUE)
fs2 <- get_fs(HolzingerSwineford1939,
model = "textual =~ x4 + x5 + x6",
std.lv = TRUE)
fs_dat <- cbind(fs1, fs2)
fs_dat2 <- get_fs_int(fs_dat,
fs_name = c("fs_visual", "fs_textual"),
se_fs = c("fs_visual_se", "fs_textual_se"),
loading_fs = c("visual_by_fs_visual",
"textual_by_fs_textual")
)
head(fs_dat2[c("fs_visual", "fs_textual", "fs_visual:fs_textual",
"fs_visual:fs_textual_se", "fs_visual:fs_textual_ld")])
#> fs_visual fs_textual fs_visual:fs_textual fs_visual:fs_textual_se
#> 1 -0.98165784 -0.036420142 -0.1913384 0.4927885
#> 2 -0.08745190 -1.072572360 -0.1332920 0.4927885
#> 3 -0.44092861 -1.891551979 0.6069489 0.4927885
#> 4 0.73898620 0.001151637 -0.2262394 0.4927885
#> 5 -0.86328354 -0.111420121 -0.1309033 0.4927885
#> 6 -0.07855806 -1.389127610 -0.1179633 0.4927885
#> fs_visual:fs_textual_ld
#> 1 0.584614
#> 2 0.584614
#> 3 0.584614
#> 4 0.584614
#> 5 0.584614
#> 6 0.584614