Skip to contents

CRAN Status R-Universe Status DOI Make Project R-CMD-check R Package Test Coverage Lint R Package Package Website (GitHub Pages) Compile LaTeX Shell Check pages-build-deployment codecov


You can install the CRAN release of semmcci with:


You can install the development version of semmcci from GitHub with:

if (!require("remotes")) install.packages("remotes")

The Monte Carlo Method

In the Monte Carlo method, a sampling distribution of parameter estimates \(\hat{\boldsymbol{\theta}}^{\ast}\) is generated from the multivariate normal distribution using the parameter estimates \(\hat{\boldsymbol{\theta}}\) and the corresponding sampling variance-covariance matrix \(\widehat{\mathrm{Var}} \left( \hat{\boldsymbol{\theta}} \right)\).

\[\begin{equation} \hat{\boldsymbol{\theta}}^{\ast} \sim \mathcal{N} \left( \hat{\boldsymbol{\theta}}, \widehat{\mathrm{Var}} \left( \hat{\boldsymbol{\theta}} \right) \right) \end{equation}\]

Confidence intervals for defined parameters \(\mathbf{g} \left( \hat{\boldsymbol{\theta}} \right)\) are generated by obtaining percentiles corresponding to \(100(1 - \alpha)\%\) from the generated sampling distribution, where \(\alpha\) is the significance level.


Monte Carlo confidence intervals for free and defined parameters Monte Carlo confidence intervals for free and defined parameters in models fitted in the structural equation modeling package lavaan can be generated using the semmcci package. The package has three main functions, namely, MC(), MCMI(), and MCStd(). The output of lavaan is passed as the first argument to the MC() function or the MCMI() function to generate Monte Carlo confidence intervals. Monte Carlo confidence intervals for the standardized estimates can also be generated by passing the output of the MC() function or the MCMI() function to the MCStd() function. A description of the package and code examples are presented in Pesigan and Cheung (2023:


To cite semmcci in publications, please cite Pesigan & Cheung (2023).


MacKinnon, D. P., Lockwood, C. M., & Williams, J. (2004). Confidence limits for the indirect effect: Distribution of the product and resampling methods. Multivariate Behavioral Research, 39(1), 99–128.
Pesigan, I. J. A., & Cheung, S. F. (2023). Monte Carlo confidence intervals for the indirect effect with missing data. Behavior Research Methods.
Preacher, K. J., & Selig, J. P. (2012). Advantages of monte carlo confidence intervals for indirect effects. Communication Methods and Measures, 6(2), 77–98.
Tofighi, D., & Kelley, K. (2019). Indirect effects in sequential mediation models: Evaluating methods for hypothesis testing and confidence interval formation. Multivariate Behavioral Research, 55(2), 188–210.
Tofighi, D., & MacKinnon, D. P. (2015). Monte Carlo confidence intervals for complex functions of indirect effects. Structural Equation Modeling: A Multidisciplinary Journal, 23(2), 194–205.