# \donttest{
## Select ATT, Bi, and BEH
obs.vars <- c("BEH", "BI", "ATT")
## Select one study from Cooke16 for illustration
my.cor <- Cooke16$data[[4]][obs.vars, obs.vars]
my.n <- Cooke16$n[4]
## Effect sizes: indirect effect and direct effect
model <- "BEH ~ c*ATT + b*BI
BI ~ a*ATT
## Indirect effect
Ind := a*b
Dir := c"
calEffSizes(model=model, n=my.n, Cov=my.cor, lavaan.output=FALSE)
## Return the lavaan fitted model
fit <- calEffSizes(model=model, n=my.n, Cov=my.cor, lavaan.output=TRUE)
lavaan::summary(fit)
lavaan::parameterestimates(fit)
# }
Run the code above in your browser using DataLab