Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calEffSizes

Calculate Effect Sizes using lavaan Models


Description

It calculates effect sizes with Delta Method by formulating the effect sizes as functions of SEM in lavaan.

Usage

calEffSizes(model, n, Cov, Mean, lavaan.output=FALSE, ...)

Arguments

model

A lavaan model. Effect sizes are defined as functions of SEM parameters with :=.

n

Sample sizes

Cov

A covariance matrix or a list of covariance matrices.

Mean

Optional sample means.

lavaan.output

If TRUE, it returns the fitted object instead of the effect sizes and their sampling covariance matrix.

...

Further arguments passed to sem.

Value

Effect sizes and their sampling covariance matrix or a lavaan fitted object.

Note

The input matrices are treated as covariance matrices unless there are explicit constraints in the model.

Author(s)

Mike W.-L. Cheung <mikewlcheung@nus.edu.sg>

References

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

See Also

Examples

## Not run:  
## 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)  

## End(Not run)

metaSEM

Meta-Analysis using Structural Equation Modeling

v1.2.5
GPL (>= 2)
Authors
Mike Cheung [aut, cre] (<https://orcid.org/0000-0003-0113-0758>)
Initial release
2020-11-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.