RMediation: An R package for mediation analysis confidence intervals

RMediation: An R package for mediation analysis confidence intervals

13 April 2011 | Davood Tofghi · David P. MacKinnon
The RMediation package is an R package that provides various methods for calculating confidence intervals (CIs) for mediated effects. Mediated effects are the product of two regression coefficients. The distribution-of-the-product method is considered the most statistically efficient for calculating CIs for mediated effects. RMediation uses this method, Monte Carlo simulations, and the asymptotic normal distribution method to compute CIs. It also generates percentiles, quantiles, and plots of the distribution and CI for the mediated effect. The existing program PRODCLIN, which is used to calculate CIs for mediated effects, has several limitations, including being cumbersome to access and not producing results for certain cases. RMediation, on the other hand, is based on the widely available R software and provides accurate results that PRODCLIN could not. It also includes several capabilities not available in PRODCLIN. The RMediation package provides functions for computing (1-α)% CIs, percentiles, and quantiles for the distribution of the product of two normal random variables. It also produces a kernel density plot of the empirical distribution of the mediated effect and an overlaid plot of the associated CI with error bars. The package includes methods for the distribution-of-the-product, Monte Carlo, and asymptotic normal distribution approaches. The RMediation package was tested in a simulation study comparing the performance of different methods in terms of Type I error rates and CI lengths. The results showed that the distribution-of-the-product method produced the most conservative CIs across all conditions. The AND method had the shortest CI length, followed by PRODCLIN, the percentile bootstrap, and then the BC bootstrap method. The BC bootstrap method had inflated Type I error rates above the nominal value of 0.05. The RMediation package is recommended for use in situations where aspects of the distribution of the product of two random variables are of interest, such as the distribution of interaction variables formed by the product of two main effect variables and the distribution of scales formed by the product of two individual scales. The distribution-of-the-product method is recommended over the AND and bootstrap methods, especially for smaller sample sizes. The bootstrap methods are not recommended because the analytical solution for testing the mediated effect already exists and is implemented in the RMediation package.The RMediation package is an R package that provides various methods for calculating confidence intervals (CIs) for mediated effects. Mediated effects are the product of two regression coefficients. The distribution-of-the-product method is considered the most statistically efficient for calculating CIs for mediated effects. RMediation uses this method, Monte Carlo simulations, and the asymptotic normal distribution method to compute CIs. It also generates percentiles, quantiles, and plots of the distribution and CI for the mediated effect. The existing program PRODCLIN, which is used to calculate CIs for mediated effects, has several limitations, including being cumbersome to access and not producing results for certain cases. RMediation, on the other hand, is based on the widely available R software and provides accurate results that PRODCLIN could not. It also includes several capabilities not available in PRODCLIN. The RMediation package provides functions for computing (1-α)% CIs, percentiles, and quantiles for the distribution of the product of two normal random variables. It also produces a kernel density plot of the empirical distribution of the mediated effect and an overlaid plot of the associated CI with error bars. The package includes methods for the distribution-of-the-product, Monte Carlo, and asymptotic normal distribution approaches. The RMediation package was tested in a simulation study comparing the performance of different methods in terms of Type I error rates and CI lengths. The results showed that the distribution-of-the-product method produced the most conservative CIs across all conditions. The AND method had the shortest CI length, followed by PRODCLIN, the percentile bootstrap, and then the BC bootstrap method. The BC bootstrap method had inflated Type I error rates above the nominal value of 0.05. The RMediation package is recommended for use in situations where aspects of the distribution of the product of two random variables are of interest, such as the distribution of interaction variables formed by the product of two main effect variables and the distribution of scales formed by the product of two individual scales. The distribution-of-the-product method is recommended over the AND and bootstrap methods, especially for smaller sample sizes. The bootstrap methods are not recommended because the analytical solution for testing the mediated effect already exists and is implemented in the RMediation package.
Reach us at info@study.space
Understanding RMediation%3A An R package for mediation analysis confidence intervals