indirectEffect: Estimate the asymptotic covariance matrix of standardized or...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/indirectEffect.R

Description

It estimates the standardized or unstandardized indirect and direct effects and their asymptotic sampling covariance matrix.

Usage

1
indirectEffect(x, n, standardized = TRUE, direct.effect = TRUE, run = TRUE)

Arguments

x

A 3x3 correlation/covariance matrix or a list of correlation/covariance matrices. Variables are arranged as dependent variable (y), mediator (m) and independent variable (x)

n

Sample size or a vector of sample sizes

standardized

Logical. Whether the indirect effect is standardized.

direct.effect

Logical. Whether the direct effect is estimated. If it is FALSE, the direct effect is fixed at zero.

run

Logical. If FALSE, only return the mx model without running the analysis.

Details

Cheung (2009) estimated the standardized indirect effect and its standard error with non-linear constraints. Since OpenMx does not generate standard errors when there are non-linear constraints, Kwan and Chan's (2011) approach is used in this function. Delta method is used to calculate the asymptotic covariance matrix.

Value

A vector (or a matrix if the input is a list of matrices) of (standardized) indirect effect, standardized direct effect and their asymptotic sampling covariance matrices

Author(s)

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

References

Cheung, M. W.-L. (2009). Comparison of methods for constructing confidence intervals of standardized indirect effects. Behavior Research Methods, 41, 425-438.

Kwan, J., & Chan, W. (2011). Comparing standardized coefficients in structural equation modeling: a model reparameterization approach. Behavior Research Methods, 43, 730-745.

Examples

1
2
3
4
5
6
7
## A correlation matrix as input
x <- matrix(c(1, 0.4, 0.2, 0.4, 1, 0.3, 0.2, 0.3, 1), ncol=3)
dimnames(x) <- list( c("y", "m", "x"), c("y", "m", "x") )
indirectEffect(x, n=300)

## A list of correlation matrices
indirectEffect( list(x, x), n=c(300,500), standardized=FALSE )

metaSEM documentation built on May 30, 2017, 4:41 a.m.

Search within the metaSEM package
Search all R packages, documentation and source code