1
$\begingroup$

Is it possible to get the probe2WayMC() function from SEMtools package for Lavaan in R to give estimates based upon the fully standardized solution of a SEM model? (i.e., using the estimates from the "Std.all" output column rather than the "Estimate" column).

I tried setting std.lv=TRUE, std.ov=TRUE to make the Estimates column the same as Std.all, but the parameters were still not the same (see "fit model: version 2" in code below).

Below is a reproductable example that mirrors my real data problem. The code (lightly edited by myself) comes from the supplementary materials of this article https://doi.org/10.3390/psych3030024 by Schoemann & Jorgensen (2021). My edited version features: continuous IV, continous moderator, continous mediator, binary DV. I am fitting a linear probability model. The code gives simple slopes for the moderation and conditional indirect effects, however, all based upon the unstandardized solution (i.e., values in the "Estimate" column not "Std.all").

# load packages
  library(lavaan)
  library(semTools)
  
# generate data
  set.seed(42)
  dat2wayMC <- indProd(dat2way, 1:3, 4:6)
  dat2wayMC$DVbinary <- sample(0:1, 10000, replace = TRUE)
  
# sem model with latent factor interactions from semTools package
  model1 <- "
  # cfa
f1 =~ x1 + x2 + x3
f2 =~ x4 + x5 + x6
f12 =~ x1.x4 + x2.x5 + x3.x6
f3 =~ x7 + x8 + x9
  # path analysis
f3 ~ f1 + f2 + f12
f12 ~~ 0*f1 + 0*f2
x1 + x4 + x1.x4 + x7 ~ 0*1 # identify latent means
f1 + f2 + f12 + f3 ~ NA*1
DVbinary ~ b*f3
"
  
# fit model: version 1
  fitMC2way <- sem(model1, data = dat2wayMC, meanstructure = TRUE)
# fit model: version 2
  fitMC2way <- sem(model1, data = dat2wayMC, meanstructure = TRUE, std.lv=TRUE, std.ov=TRUE)
  summary(fitMC2way, standardized=TRUE)
  
# latent factor moderation
  probe <- probe2WayMC(fitMC2way, nameX = c("f1", "f2", "f12"), 
                       nameY = "f3", modVar = "f2", valProbe = c(-1, 0, 1))
  probe$SimpleSlope
# conditional indirect effects on newDV
  probe$SimpleSlope$est * coef(fitMC2way)[["b"]]
  
# custom function to return simple slopes
  condIndFX <- function(fit) {
    condFX <- probe2WayMC(fit, nameX = c("f1", "f2", "f12"), nameY = "f3",
                          modVar = "f2", valProbe = c(-1, 0, 1))
    indFX <- condFX$SimpleSlope$est * coef(fit)[["b"]]
    names(indFX) <- paste("f2 =", condFX$SimpleSlope$f2)
    indFX
  }
# test once on original data
  condIndFX(fitMC2way)
  
# (too small) bootstrap sample of simple slopes
  bootOut <- bootstrapLavaan(fitMC2way, R = 10, FUN = condIndFX)
# percentile 95% CI
  apply(bootOut, MARGIN = 2, FUN = quantile, probs = c(.025, .975))
```
$\endgroup$

1 Answer 1

2
$\begingroup$

NOTE: The answer I provided in June 2022 was incorrect because it only considered standardization of indicators, not common factors. The former answer has been replaced with the edited answer below.

You cannot easily obtain a valid standardized solution when there are latent interactions (certainly not from the Std.all column or standardizedSolution() function), because (at least) one of the latent factors is supposed to be interpreted as a product of other latent factors.

It is a simple task to first standardize observed variables to have SD = 1, then calculate product-indicators, so that parameters can be estimated in units of SD for the indicators. For example:

## center=FALSE because the intercepts 
## don't matter for standardized slopes
dat2wayST <- as.data.frame(scale(dat2way, center = FALSE, scale = TRUE))
dat2wayST.MC <- indProd(dat2wayST, 1:3, 4:6)

However, we cannot do such calculations with unobserved (latent) variables. Even if we identify the model by fixing factor variances = 1 (so latent variables are also standardized), the factor that represents the interaction would not have SD = 1 if its constituent lower-order factors had SD = 1. There are analytical expectations that could be calculated for what that variance might be (on the assumption of normality, which is already made about latent variables in SEM), but they are not simple:

https://en.wikipedia.org/wiki/Distribution_of_the_product_of_two_random_variables#Correlated_central-normal_distributions

If you manage to implement this, you should not trust the SEs or test statistics for these standardized estimates, as they do not account for the uncertainty of the sample-estimated SDs used to standardize the observed variables. The standardized estimates would merely be effect sizes to report along side unstandardized estimates and their tests.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.