Learn R Programming

RMediation (version 1.1.3)

RMediation-package: RMediation: An R Package for Mediation Analysis Confidence Intervals

Description

RMediation package provides functions to compute confidence intervals (CIs) for a well--defined nonlinear function of the model parameters (e.g., product of k coefficients) in single--level and multilevel structural equation models.

Arguments

Details

ll{ Package: RMediation Type: Package Version: 1.1.3 Date: 2014-3-6 License: GPL-2 LazyLoad: yes }medci produces a CI for the product of two normal random variables using three methods: the distribution of the product of coefficients, Monte Carlo, and asymptotic normal theory with the multivariate-delta standard error (Asymptotic-Delta) method. pprodnormal produces percentiles for the distribution of product of two normal random variables. qprodnormal generates quantiles for the distribution of product of two normal random variables. ci produces a CI for a well--defined nonlinear function of the model parameters in single--level and multilevel structural equation models using the Monte Carlo and Asymptotic-Delta method.

References

MacKinnon, D. P., Fritz, M. S., Williams, J., and Lockwood, C. M. (2007). Distribution of the product confidence limits for the indirect effect: Program PRODCLIN. Behavior Research Methods, 39, 384--389. Meeker, W. and Escobar, L. (1994). An algorithm to compute the CDF of the product of two normal random variables. Communications in Statistics: Simulation and Computation, 23, 271--280.

Tofighi, D. and MacKinnon, D. P. (2011). RMediation: An R package for mediation analysis confidence intervals. Behavior Research Methods, 43, 692--700. doi:10.3758/s13428-011-0076-x

See Also

qprodnormal pprodnormal medci ci

Examples

Run this code
medci(mu.x=.2,mu.y=.4,se.x=.1,se.y=.05,rho=0,alpha=.05)
pprodnormal(q=.4, mu.x=.5, mu.y=.3, se.x=.03, se.y=.08, rho= 0)
qprodnormal(p=.1, mu.x=.5, mu.y=.3, se.x=.03, se.y=.8, rho=0)
ci(mu=c(b1=0,b2=0),Sigma=c(1,2,10), quant=~b1*b2)
ci(mu=c(b1=1,b2=.7,b3=.6, b4= .45), Sigma=c(.05,0,0,0,.05,0,0, .03, 0, .03),
quant=~b1*b2*b3*b4, type="all", plot=TRUE, plotCI=TRUE)

Run the code above in your browser using DataLab