NA. <- 'ZMHAS_12 ~ a*ZNA
ZPMH_scale ~ b*ZMHAS_12 + c*ZNA
indirect := a*b
direct := c
total := c + (a*b)'
fit <- sem(NA., data = data, estimator = "MLR")
summary(fit, standardized=T, fit.measures=T, rsq = T)
Now my question is where I can see whether the R-squares are significant?
# test Rsq for mediator, same as Wald z from summary() but squared
lavTestWald(fit, constraints = 'a == 0')
# test Rsq for outcome
lavTestWald(fit, constraints = 'b == 0 ; c == 0')