get_fs_int-example
Jimmy Zhang
2024-09-06
get_fs_int-vignette.Rmd
library(lavaan)
#> This is lavaan 0.6-18
#> lavaan is FREE software! Please report any bugs.
library(R2spa)
get_fs_int
Function
This function is designed to create product indicators for first-order factor score indicators with standard errors and model-implied loadings. With a specified model, the product indicator pairs will be generated based on the model syntax; without a specified model, the function will by default generate all possible pairs of product indicators.
Illustrative Example
We will simulate a dataset with four firsr-order latent variables: x, m, z, y
set.seed(2116)
## Sample size:
num_obs <- 5000
# Structural Parameters:
## gamma_x = 0.3, gamma_m = 0.4, gamma_z = 0.2
## gamma_xm = 0.1, gamma_xz = 0.15, gamma_mz = 0.12
# Correlation between latent variables:
## cor_xm = 0.2, cor_xz = 0.3, cor_zm = 0.4
# Data simulation:
## x, z, m, ey
cov_xmz_ey <- matrix(c(1, 0.1, 0.15, 0,
0.1, 1, 0.12, 0,
0.15, 0.12, 1, 0,
0, 0, 0, 0.481351), nrow = 4)
eta <- as.data.frame(
MASS::mvrnorm(num_obs,
mu = rep(0, 4), Sigma = cov_xmz_ey,
empirical = FALSE
)
)
names(eta) <- c("x", "m", "z", "ey")
# xm, xz, mz
eta <- eta |>
transform(
xm = x * m,
xz = x * z,
mz = m * z
)
# y
etay <- 0.3 * eta$x + 0.4 * eta$m + 0.2 * eta$z +
0.1 * eta$xm + 0.15 * eta$xz + 0.12 * eta$mz + eta$ey
# Observed Indicators
lambda_x <- c(0.9, 0.8, 0.7)
lambda_m <- c(0.85, 0.75, 0.65)
lambda_z <- c(0.8, 0.7, 0.6)
lambda_y <- c(0.75, 0.7, 0.65)
x_obs <- eta$x %*% t(lambda_x) + rnorm(num_obs * length(lambda_x))
m_obs <- eta$m %*% t(lambda_m) + rnorm(num_obs * length(lambda_m))
z_obs <- eta$z %*% t(lambda_z) + rnorm(num_obs * length(lambda_z))
y_obs <- etay %*% t(lambda_y) + rnorm(num_obs * length(lambda_z))
# Dataset: raw score
df <- cbind(x_obs, m_obs, z_obs, y_obs)
df <- as.data.frame(df)
names(df) <- c(
paste0("x", 1:3), paste0("m", 1:3),
paste0("z", 1:3), paste0("y", 1:3)
)
Obtain factor scores using get_fs()
fs_dat <- get_fs(df, model = "x =~ x1 + x2 + x3
m =~ m1 + m2 + m3
z =~ z1 + z2 + z3
y =~ y1 + y2 + y3",
std.lv = TRUE,
method = "Bartlett")
head(fs_dat)
#> fs_x fs_m fs_z fs_y fs_x_se fs_m_se fs_z_se
#> 1 -1.57082033 0.5158033 -2.4166532 0.6803742 0.7007543 0.7621661 0.7919491
#> 2 -1.28761379 1.5073520 -1.2254840 0.6479675 0.7007543 0.7621661 0.7919491
#> 3 1.05055317 1.3509779 0.9886338 -1.0717407 0.7007543 0.7621661 0.7919491
#> 4 -1.24981810 -0.4465930 -1.1941697 -0.2898219 0.7007543 0.7621661 0.7919491
#> 5 0.03723966 -2.0745305 -0.7534680 0.8267039 0.7007543 0.7621661 0.7919491
#> 6 -0.30949355 0.3911142 -0.6878682 -1.2723421 0.7007543 0.7621661 0.7919491
#> fs_y_se x_by_fs_x x_by_fs_m x_by_fs_z x_by_fs_y m_by_fs_x m_by_fs_m
#> 1 0.9035465 1 0 0 0 0 1
#> 2 0.9035465 1 0 0 0 0 1
#> 3 0.9035465 1 0 0 0 0 1
#> 4 0.9035465 1 0 0 0 0 1
#> 5 0.9035465 1 0 0 0 0 1
#> 6 0.9035465 1 0 0 0 0 1
#> m_by_fs_z m_by_fs_y z_by_fs_x z_by_fs_m z_by_fs_z z_by_fs_y y_by_fs_x
#> 1 0 0 0 0 1 0 0
#> 2 0 0 0 0 1 0 0
#> 3 0 0 0 0 1 0 0
#> 4 0 0 0 0 1 0 0
#> 5 0 0 0 0 1 0 0
#> 6 0 0 0 0 1 0 0
#> y_by_fs_m y_by_fs_z y_by_fs_y ev_fs_x ecov_fs_m_fs_x ev_fs_m
#> 1 0 0 1 0.4910567 0 0.5808972
#> 2 0 0 1 0.4910567 0 0.5808972
#> 3 0 0 1 0.4910567 0 0.5808972
#> 4 0 0 1 0.4910567 0 0.5808972
#> 5 0 0 1 0.4910567 0 0.5808972
#> 6 0 0 1 0.4910567 0 0.5808972
#> ecov_fs_z_fs_x ecov_fs_z_fs_m ev_fs_z ecov_fs_y_fs_x ecov_fs_y_fs_m
#> 1 0 0 0.6271834 0 0
#> 2 0 0 0.6271834 0 0
#> 3 0 0 0.6271834 0 0
#> 4 0 0 0.6271834 0 0
#> 5 0 0 0.6271834 0 0
#> 6 0 0 0.6271834 0 0
#> ecov_fs_y_fs_z ev_fs_y
#> 1 0 0.8163963
#> 2 0 0.8163963
#> 3 0 0.8163963
#> 4 0 0.8163963
#> 5 0 0.8163963
#> 6 0 0.8163963
Obtain product-indicator of factor scores, and the corresponding standard errors. Double-mean-centering is used.
# With specified model
ind_1 <- get_fs_int(dat = fs_dat,
fs_name = c("fs_x", "fs_m", "fs_z"),
se_fs = c("fs_x_se", "fs_m_se", "fs_z_se"),
loading_fs = c("x_by_fs_x", "m_by_fs_m", "z_by_fs_z"),
model = "fs_x:fs_m + fs_x:fs_z")
head(ind_1)
#> fs_x fs_m fs_z fs_y fs_x_se fs_m_se fs_z_se
#> 1 -1.57082033 0.5158033 -2.4166532 0.6803742 0.7007543 0.7621661 0.7919491
#> 2 -1.28761379 1.5073520 -1.2254840 0.6479675 0.7007543 0.7621661 0.7919491
#> 3 1.05055317 1.3509779 0.9886338 -1.0717407 0.7007543 0.7621661 0.7919491
#> 4 -1.24981810 -0.4465930 -1.1941697 -0.2898219 0.7007543 0.7621661 0.7919491
#> 5 0.03723966 -2.0745305 -0.7534680 0.8267039 0.7007543 0.7621661 0.7919491
#> 6 -0.30949355 0.3911142 -0.6878682 -1.2723421 0.7007543 0.7621661 0.7919491
#> fs_y_se x_by_fs_x x_by_fs_m x_by_fs_z x_by_fs_y m_by_fs_x m_by_fs_m
#> 1 0.9035465 1 0 0 0 0 1
#> 2 0.9035465 1 0 0 0 0 1
#> 3 0.9035465 1 0 0 0 0 1
#> 4 0.9035465 1 0 0 0 0 1
#> 5 0.9035465 1 0 0 0 0 1
#> 6 0.9035465 1 0 0 0 0 1
#> m_by_fs_z m_by_fs_y z_by_fs_x z_by_fs_m z_by_fs_z z_by_fs_y y_by_fs_x
#> 1 0 0 0 0 1 0 0
#> 2 0 0 0 0 1 0 0
#> 3 0 0 0 0 1 0 0
#> 4 0 0 0 0 1 0 0
#> 5 0 0 0 0 1 0 0
#> 6 0 0 0 0 1 0 0
#> y_by_fs_m y_by_fs_z y_by_fs_y ev_fs_x ecov_fs_m_fs_x ev_fs_m
#> 1 0 0 1 0.4910567 0 0.5808972
#> 2 0 0 1 0.4910567 0 0.5808972
#> 3 0 0 1 0.4910567 0 0.5808972
#> 4 0 0 1 0.4910567 0 0.5808972
#> 5 0 0 1 0.4910567 0 0.5808972
#> 6 0 0 1 0.4910567 0 0.5808972
#> ecov_fs_z_fs_x ecov_fs_z_fs_m ev_fs_z ecov_fs_y_fs_x ecov_fs_y_fs_m
#> 1 0 0 0.6271834 0 0
#> 2 0 0 0.6271834 0 0
#> 3 0 0 0.6271834 0 0
#> 4 0 0 0.6271834 0 0
#> 5 0 0 0.6271834 0 0
#> 6 0 0 0.6271834 0 0
#> ecov_fs_y_fs_z ev_fs_y fs_x:fs_m fs_x:fs_m_se fs_x:fs_m_ld fs_x:fs_z
#> 1 0 0.8163963 -0.9160818 1.164992 1 3.6292445
#> 2 0 0.8163963 -2.0467348 1.164992 1 1.4110667
#> 3 0 0.8163963 1.3134266 1.164992 1 0.8717289
#> 4 0 0.8163963 0.4523125 1.164992 1 1.3256114
#> 5 0 0.8163963 -0.1831024 1.164992 1 -0.1949424
#> 6 0 0.8163963 -0.2268949 1.164992 1 0.0460073
#> fs_x:fs_z_se fs_x:fs_z_ld
#> 1 1.194246 1
#> 2 1.194246 1
#> 3 1.194246 1
#> 4 1.194246 1
#> 5 1.194246 1
#> 6 1.194246 1
# Without specified model
ind_2 <- get_fs_int(dat = fs_dat,
fs_name = c("fs_x", "fs_m", "fs_z"),
se_fs = c("fs_x_se", "fs_m_se", "fs_z_se"),
loading_fs = c("x_by_fs_x", "m_by_fs_m", "z_by_fs_z"))
head(ind_2)
#> fs_x fs_m fs_z fs_y fs_x_se fs_m_se fs_z_se
#> 1 -1.57082033 0.5158033 -2.4166532 0.6803742 0.7007543 0.7621661 0.7919491
#> 2 -1.28761379 1.5073520 -1.2254840 0.6479675 0.7007543 0.7621661 0.7919491
#> 3 1.05055317 1.3509779 0.9886338 -1.0717407 0.7007543 0.7621661 0.7919491
#> 4 -1.24981810 -0.4465930 -1.1941697 -0.2898219 0.7007543 0.7621661 0.7919491
#> 5 0.03723966 -2.0745305 -0.7534680 0.8267039 0.7007543 0.7621661 0.7919491
#> 6 -0.30949355 0.3911142 -0.6878682 -1.2723421 0.7007543 0.7621661 0.7919491
#> fs_y_se x_by_fs_x x_by_fs_m x_by_fs_z x_by_fs_y m_by_fs_x m_by_fs_m
#> 1 0.9035465 1 0 0 0 0 1
#> 2 0.9035465 1 0 0 0 0 1
#> 3 0.9035465 1 0 0 0 0 1
#> 4 0.9035465 1 0 0 0 0 1
#> 5 0.9035465 1 0 0 0 0 1
#> 6 0.9035465 1 0 0 0 0 1
#> m_by_fs_z m_by_fs_y z_by_fs_x z_by_fs_m z_by_fs_z z_by_fs_y y_by_fs_x
#> 1 0 0 0 0 1 0 0
#> 2 0 0 0 0 1 0 0
#> 3 0 0 0 0 1 0 0
#> 4 0 0 0 0 1 0 0
#> 5 0 0 0 0 1 0 0
#> 6 0 0 0 0 1 0 0
#> y_by_fs_m y_by_fs_z y_by_fs_y ev_fs_x ecov_fs_m_fs_x ev_fs_m
#> 1 0 0 1 0.4910567 0 0.5808972
#> 2 0 0 1 0.4910567 0 0.5808972
#> 3 0 0 1 0.4910567 0 0.5808972
#> 4 0 0 1 0.4910567 0 0.5808972
#> 5 0 0 1 0.4910567 0 0.5808972
#> 6 0 0 1 0.4910567 0 0.5808972
#> ecov_fs_z_fs_x ecov_fs_z_fs_m ev_fs_z ecov_fs_y_fs_x ecov_fs_y_fs_m
#> 1 0 0 0.6271834 0 0
#> 2 0 0 0.6271834 0 0
#> 3 0 0 0.6271834 0 0
#> 4 0 0 0.6271834 0 0
#> 5 0 0 0.6271834 0 0
#> 6 0 0 0.6271834 0 0
#> ecov_fs_y_fs_z ev_fs_y fs_x:fs_m fs_x:fs_m_se fs_x:fs_m_ld fs_x:fs_z
#> 1 0 0.8163963 -0.9160818 1.164992 1 3.6292445
#> 2 0 0.8163963 -2.0467348 1.164992 1 1.4110667
#> 3 0 0.8163963 1.3134266 1.164992 1 0.8717289
#> 4 0 0.8163963 0.4523125 1.164992 1 1.3256114
#> 5 0 0.8163963 -0.1831024 1.164992 1 -0.1949424
#> 6 0 0.8163963 -0.2268949 1.164992 1 0.0460073
#> fs_x:fs_z_se fs_x:fs_z_ld fs_m:fs_z fs_m:fs_z_se fs_m:fs_z_ld
#> 1 1.194246 1 -1.3748087 1.253958 1
#> 2 1.194246 1 -1.9755270 1.253958 1
#> 3 1.194246 1 1.2073313 1.253958 1
#> 4 1.194246 1 0.4050167 1.253958 1
#> 5 1.194246 1 1.4348013 1.253958 1
#> 6 1.194246 1 -0.3973261 1.253958 1
2S-PA with product factor score indicator
# Rename product factor scores to be used with `tspa()`
ind_2$fs_xm <- ind_2$`fs_x:fs_m`
ind_2$fs_xz <- ind_2$`fs_x:fs_z`
ind_2$fs_mz <- ind_2$`fs_m:fs_z`
tspa_fit <- tspa("
y ~ x + m + z + xm + xz + mz
", data = ind_2,
se_fs = c(
y = ind_2[1, "fs_y_se"],
x = ind_2[1, "fs_x_se"],
m = ind_2[1, "fs_m_se"],
z = ind_2[1, "fs_z_se"],
xm = ind_2[1, "fs_x:fs_m_se"],
xz = ind_2[1, "fs_x:fs_z_se"],
mz = ind_2[1, "fs_m:fs_z_se"]
))
standardizedSolution(tspa_fit)
#> lhs op rhs est.std se z pvalue ci.lower ci.upper
#> 1 y =~ fs_y 0.742 0.006 122.490 0.000 0.730 0.754
#> 2 x =~ fs_x 0.819 0.004 203.643 0.000 0.811 0.827
#> 3 m =~ fs_m 0.795 0.005 172.148 0.000 0.786 0.804
#> 4 z =~ fs_z 0.784 0.005 159.443 0.000 0.774 0.794
#> 5 xm =~ fs_xm 0.662 0.008 77.988 0.000 0.645 0.679
#> 6 xz =~ fs_xz 0.649 0.009 72.742 0.000 0.631 0.666
#> 7 mz =~ fs_mz 0.651 0.009 73.382 0.000 0.633 0.668
#> 8 fs_y ~~ fs_y 0.449 0.009 50.000 0.000 0.432 0.467
#> 9 fs_x ~~ fs_x 0.329 0.007 50.000 0.000 0.316 0.342
#> 10 fs_m ~~ fs_m 0.367 0.007 50.000 0.000 0.353 0.382
#> 11 fs_z ~~ fs_z 0.385 0.008 50.000 0.000 0.370 0.401
#> 12 fs_xm ~~ fs_xm 0.562 0.011 50.000 0.000 0.540 0.584
#> 13 fs_xz ~~ fs_xz 0.579 0.012 50.000 0.000 0.556 0.602
#> 14 fs_mz ~~ fs_mz 0.577 0.012 50.000 0.000 0.554 0.599
#> 15 y ~ x 0.341 0.022 15.484 0.000 0.298 0.385
#> 16 y ~ m 0.406 0.022 18.561 0.000 0.363 0.448
#> 17 y ~ z 0.189 0.023 8.056 0.000 0.143 0.235
#> 18 y ~ xm 0.062 0.030 2.037 0.042 0.002 0.122
#> 19 y ~ xz 0.178 0.029 6.106 0.000 0.121 0.236
#> 20 y ~ mz 0.083 0.030 2.740 0.006 0.024 0.143
#> 21 y ~~ y 0.556 0.025 22.657 0.000 0.508 0.604
#> 22 x ~~ x 1.000 0.000 NA NA 1.000 1.000
#> 23 m ~~ m 1.000 0.000 NA NA 1.000 1.000
#> 24 z ~~ z 1.000 0.000 NA NA 1.000 1.000
#> 25 xm ~~ xm 1.000 0.000 NA NA 1.000 1.000
#> 26 xz ~~ xz 1.000 0.000 NA NA 1.000 1.000
#> 27 mz ~~ mz 1.000 0.000 NA NA 1.000 1.000
#> 28 x ~~ m 0.106 0.022 4.907 0.000 0.064 0.148
#> 29 x ~~ z 0.167 0.022 7.699 0.000 0.124 0.209
#> 30 x ~~ xm -0.030 0.026 -1.157 0.247 -0.081 0.021
#> 31 x ~~ xz -0.067 0.027 -2.520 0.012 -0.119 -0.015
#> 32 x ~~ mz 0.027 0.027 1.007 0.314 -0.025 0.079
#> 33 m ~~ z 0.128 0.022 5.708 0.000 0.084 0.172
#> 34 m ~~ xm 0.034 0.027 1.256 0.209 -0.019 0.086
#> 35 m ~~ xz 0.028 0.027 1.029 0.304 -0.026 0.082
#> 36 m ~~ mz -0.013 0.027 -0.491 0.624 -0.067 0.040
#> 37 z ~~ xm 0.028 0.027 1.024 0.306 -0.026 0.081
#> 38 z ~~ xz 0.047 0.028 1.701 0.089 -0.007 0.102
#> 39 z ~~ mz 0.028 0.028 1.017 0.309 -0.026 0.083
#> 40 xm ~~ xz 0.213 0.033 6.544 0.000 0.149 0.277
#> 41 xm ~~ mz 0.282 0.032 8.769 0.000 0.219 0.345
#> 42 xz ~~ mz 0.173 0.033 5.204 0.000 0.108 0.238
The above example assumes that the factor scores are obtained from a model where the latent variances are assumed to be 1. If that is not the case, users should specify the corresponding latent variance estimate from the model, as in the following example, with the factor scores obtained from separate measurement models.
mody <- "y =~ y1 + y2 + y3"
mod1 <- "x =~ x1 + x2 + x3"
mod2 <- "m =~ m1 + m2 + m3"
mod3 <- "z =~ z1 + z2 + z3"
cfay <- cfa(mody, data = df)
cfa1 <- cfa(mod1, data = df)
cfa2 <- cfa(mod2, data = df)
cfa3 <- cfa(mod3, data = df)
# Latent variances
(lat_var <- vapply(list(cfa1, cfa2, cfa3),
FUN = function(x) lavInspect(x, "cov.lv"),
FUN.VALUE = numeric(1)))
#> [1] 0.8296271 0.7118338 0.6750885
fs_dat2 <- lapply(list(cfay, cfa1, cfa2, cfa3),
FUN = augment_lav_predict,
method = "Bartlett"
) |>
do.call(what = cbind)
# With user-specified latent variance
ind_3 <- get_fs_int(dat = fs_dat2,
fs_name = c("fs_x", "fs_m", "fs_z"),
se_fs = c("se_fs_x", "se_fs_m", "se_fs_z"),
lat_var = lat_var,
loading_fs = c("x_by_fs_x", "m_by_fs_m", "z_by_fs_z"))
head(ind_3)
#> fs_y se_fs_y y_by_fs_y ev_fs_y fs_x se_fs_x x_by_fs_x
#> 1 0.4575840 0.6283493 1 0.3948229 -1.42777196 0.6396597 1
#> 2 0.4401277 0.6283493 1 0.3948229 -1.17905836 0.6396597 1
#> 3 -0.7629969 0.6283493 1 0.3948229 0.94924494 0.6396597 1
#> 4 -0.1888135 0.6283493 1 0.3948229 -1.13986480 0.6396597 1
#> 5 0.5901120 0.6283493 1 0.3948229 0.04530066 0.6396597 1
#> 6 -0.9137330 0.6283493 1 0.3948229 -0.30930312 0.6396597 1
#> ev_fs_x fs_m se_fs_m m_by_fs_m ev_fs_m fs_z se_fs_z
#> 1 0.4091646 0.4518302 0.6441129 1 0.4148814 -1.9838745 0.6533299
#> 2 0.4091646 1.2746252 0.6441129 1 0.4148814 -0.9859401 0.6533299
#> 3 0.4091646 1.1487800 0.6441129 1 0.4148814 0.8175038 0.6533299
#> 4 0.4091646 -0.3622108 0.6441129 1 0.4148814 -1.0054432 0.6533299
#> 5 0.4091646 -1.7556345 0.6441129 1 0.4148814 -0.6048528 0.6533299
#> 6 0.4091646 0.3447030 0.6441129 1 0.4148814 -0.5758447 0.6533299
#> z_by_fs_z ev_fs_z fs_x:fs_m fs_x:fs_m_se fs_x:fs_m_ld fs_x:fs_z
#> 1 1 0.42684 -0.7264351 0.8973343 1 2.70788210
#> 2 1 0.42684 -1.5841821 0.8973343 1 1.03784270
#> 3 1 0.42684 1.0091489 0.8973343 1 0.65137310
#> 4 1 0.42684 0.3315466 0.8973343 1 1.02143110
#> 5 1 0.42684 -0.1608561 0.8973343 1 -0.15203845
#> 6 1 0.42684 -0.1879424 0.8973343 1 0.05347234
#> fs_x:fs_z_se fs_x:fs_z_ld fs_m:fs_z fs_m:fs_z_se fs_m:fs_z_ld
#> 1 0.8972113 1 -0.9848401 0.8723582 1
#> 2 0.8972113 1 -1.3451698 0.8723582 1
#> 3 0.8972113 1 0.8506663 0.8723582 1
#> 4 0.8972113 1 0.2757167 0.8723582 1
#> 5 0.8972113 1 0.9734347 0.8723582 1
#> 6 0.8972113 1 -0.2869611 0.8723582 1
2S-PA with product factor score indicator
# Rename product factor scores to be used with `tspa()`
ind_3$fs_xm <- ind_3$`fs_x:fs_m`
ind_3$fs_xz <- ind_3$`fs_x:fs_z`
ind_3$fs_mz <- ind_3$`fs_m:fs_z`
tspa_fit <- tspa("
y ~ x + m + z + xm + xz + mz
", data = ind_3,
se_fs = c(
y = ind_3[1, "se_fs_y"],
x = ind_3[1, "se_fs_x"],
m = ind_3[1, "se_fs_m"],
z = ind_3[1, "se_fs_z"],
xm = ind_3[1, "fs_x:fs_m_se"],
xz = ind_3[1, "fs_x:fs_z_se"],
mz = ind_3[1, "fs_m:fs_z_se"]
))
standardizedSolution(tspa_fit)
#> lhs op rhs est.std se z pvalue ci.lower ci.upper
#> 1 y =~ fs_y 0.742 0.006 122.531 0.000 0.730 0.754
#> 2 x =~ fs_x 0.818 0.004 202.761 0.000 0.810 0.826
#> 3 m =~ fs_m 0.795 0.005 171.575 0.000 0.786 0.804
#> 4 z =~ fs_z 0.783 0.005 158.160 0.000 0.773 0.792
#> 5 xm =~ fs_xm 0.661 0.009 77.654 0.000 0.644 0.678
#> 6 xz =~ fs_xz 0.647 0.009 72.179 0.000 0.630 0.665
#> 7 mz =~ fs_mz 0.649 0.009 72.823 0.000 0.632 0.667
#> 8 fs_y ~~ fs_y 0.449 0.009 50.000 0.000 0.432 0.467
#> 9 fs_x ~~ fs_x 0.330 0.007 50.000 0.000 0.317 0.343
#> 10 fs_m ~~ fs_m 0.368 0.007 50.000 0.000 0.354 0.383
#> 11 fs_z ~~ fs_z 0.387 0.008 50.000 0.000 0.372 0.403
#> 12 fs_xm ~~ fs_xm 0.563 0.011 50.000 0.000 0.541 0.585
#> 13 fs_xz ~~ fs_xz 0.581 0.012 50.000 0.000 0.558 0.604
#> 14 fs_mz ~~ fs_mz 0.579 0.012 50.000 0.000 0.556 0.601
#> 15 y ~ x 0.341 0.022 15.440 0.000 0.297 0.384
#> 16 y ~ m 0.406 0.022 18.551 0.000 0.363 0.448
#> 17 y ~ z 0.189 0.024 8.040 0.000 0.143 0.235
#> 18 y ~ xm 0.063 0.031 2.050 0.040 0.003 0.122
#> 19 y ~ xz 0.179 0.029 6.098 0.000 0.121 0.236
#> 20 y ~ mz 0.083 0.031 2.717 0.007 0.023 0.143
#> 21 y ~~ y 0.556 0.025 22.639 0.000 0.508 0.604
#> 22 x ~~ x 1.000 0.000 NA NA 1.000 1.000
#> 23 m ~~ m 1.000 0.000 NA NA 1.000 1.000
#> 24 z ~~ z 1.000 0.000 NA NA 1.000 1.000
#> 25 xm ~~ xm 1.000 0.000 NA NA 1.000 1.000
#> 26 xz ~~ xz 1.000 0.000 NA NA 1.000 1.000
#> 27 mz ~~ mz 1.000 0.000 NA NA 1.000 1.000
#> 28 x ~~ m 0.106 0.022 4.900 0.000 0.063 0.148
#> 29 x ~~ z 0.167 0.022 7.665 0.000 0.124 0.209
#> 30 x ~~ xm -0.029 0.026 -1.118 0.264 -0.080 0.022
#> 31 x ~~ xz -0.065 0.027 -2.447 0.014 -0.117 -0.013
#> 32 x ~~ mz 0.027 0.027 1.022 0.307 -0.025 0.079
#> 33 m ~~ z 0.128 0.023 5.665 0.000 0.083 0.172
#> 34 m ~~ xm 0.032 0.027 1.203 0.229 -0.020 0.085
#> 35 m ~~ xz 0.029 0.027 1.044 0.296 -0.025 0.083
#> 36 m ~~ mz -0.014 0.027 -0.503 0.615 -0.068 0.040
#> 37 z ~~ xm 0.028 0.027 1.039 0.299 -0.025 0.082
#> 38 z ~~ xz 0.047 0.028 1.687 0.092 -0.008 0.102
#> 39 z ~~ mz 0.028 0.028 1.003 0.316 -0.027 0.082
#> 40 xm ~~ xz 0.214 0.033 6.567 0.000 0.150 0.278
#> 41 xm ~~ mz 0.282 0.032 8.751 0.000 0.219 0.346
#> 42 xz ~~ mz 0.175 0.033 5.245 0.000 0.110 0.241
Note that the unstandardized coefficients are on a different scale compared to the previous example, as the latent variables are scaled differently.