| calEffSizes | R Documentation |
Variable names, data column names and ordinary parameter labels must not
contain periods; rename them consistently, e.g., x.1 to x_1.
It calculates effect sizes with Delta Method by formulating the effect sizes as functions of SEM in lavaan.
calEffSizes(
model,
data = NULL,
n,
Cov,
Mean = NULL,
group = NULL,
lavaan.output = FALSE,
warn = FALSE,
...
)
model |
A lavaan model. Effect sizes are defined as functions of SEM
parameters with |
data |
A data frame of the observed variables. If it is |
n |
Sample sizes |
Cov |
A covariance matrix or a list of covariance matrices. |
Mean |
Optional sample means. |
group |
A character of the variable name in the data frame defining the groups in a multiple group analysis. |
lavaan.output |
If |
warn |
If |
... |
Further arguments passed to |
Effect sizes and their sampling covariance matrix or a lavaan fitted object.
The input matrices are treated as covariance matrices unless there are explicit constraints in the model.
Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>
Cheung, M. W.-L. (2015). Meta-analysis: A structural equation modeling approach. Chichester, West Sussex: John Wiley & Sons, Inc.
Cheung, M. W.-L. (2018). Computing multivariate effect sizes and their sampling covariance matrices with structural equation modeling: Theory, examples, and computer simulations. Frontiers in Psychology, 9(1387). https://doi.org/10.3389/fpsyg.2018.01387
smdMES, smdMTS
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.