Monte Carlo Method for

Assessing Multilevel Mediation

Assessing Multilevel Mediation

An interactive tool for creating confidence intervals for indirect effects in 1-1-1 multilevel models

© 2010-2019,

Kristopher J. Preacher

Kristopher J. Preacher

Monte Carlo method for assessing multilevel Mediation: An interactive tool for creating confidence intervals for indirect effects in 1-1-1 multilevel models

Kristopher J. Preacher (*Vanderbilt University*)

James P. Selig (*University of Arkansas for Medical Sciences*)

This web utility may be cited in APA style in the following manner:

Preacher, K. J., & Selig, J. P. (2010, July). Monte Carlo method for assessing multilevel Mediation: An interactive tool for creating confidence intervals for indirect effects in 1-1-1 multilevel models [Computer software]. Available from http://quantpsy.org/.

If the Rweb server is not working

The code generated by this utility can be pasted directly into an R console window. R (a free, open-source statistical computing environment) may be obtained here: http://cran.r-project.org/.

Mediation is said to occur when the effect of one variable on another is transmitted through an intervening variable. The following diagram depicts a mediated effect. Here the effect of the independent variable (*X*) on the dependent variable (*Y*) is transmitted by the mediator variable (*M*). The point estimate of the mediated effect can be represented as the product of the *a* and *b* coefficients (i.e., *a*×*b*). See MacKinnon (2008) for a complete treatment of Mediation models.

Multilevel models (also called hierarchical models or mixed effect models) are used for data that have a nested structure (e.g., students nested within classrooms or repeated observations nested within individuals). In such two-level models, random effects are possible such that the effect of a level-1 predictor can vary across level-2 units.

Mediation in the context of a multilevel model can involve independent variables and mediator variables measured at either level-1 or level-2. Conventional software for multilevel modeling permits dependent variables to be measured only at level-1. Possible configurations for multilevel Mediation models include: 2-2-1, 2-1-1, and 1-1-1. Where the value of the integer represents the level at which that variable is measured. In the special case of the 1-1-1 model, both the *a* and *b* coefficients can vary across level-1 units. This in turn means that the *a* and *b* coefficients may covary and the estimate of the indirect effect is no longer simply the product *a*×*b*, but instead *a*×*b* + *τ*_{a,b}, where *τ*_{a,b} is the level-2 covariance between the two random effects. The covariance term needs to be added to *a*×*b* only when both the *a* and *b* slopes are random. For all other models mentioned above, the simple product is sufficient to quantify the indirect effect, and another calculator would be more appropriate. See Kenny, Korchmaros, and Bolger (2003) or Bauer, Preacher, and Gil (2006) for further information.

There are several methods for testing Mediation effects for single level Mediation models (cite Mackinnon). One promising method for constructing confidence intervals for indirect effects in single level regression is a Monte Carlo approach used by MacKinnon, Lockwood, and Williams (2004). Bauer et al. (2006) adapted this approach to the multilevel Mediation model.

This approach can be used as long as seven pieces of information are available from the results of a multilevel Mediation model. These estimates can be found using most multilevel modeling software. The estimates will include fixed and random effects as well as estimates from the asymptotic covariance matrix (ACM), or the covariance matrix of the model parameters. These estimates are described in more detail in the following.

Following the notation of Bauer et al. (2006), the two equations describing the fixed effects for a multilevel Mediation model are as follows:

The coefficient *a*_{j} (the effect of *X* on *M*) and *b*_{j} (the effect of *M* on *Y* conditional on *X*), will be used to compute the estimate of the indirect effect.

In the above equations, all intercept and slope terms are random. The level-2 covariance matrix can be represented as follows:

where elements on the diagonal are level-2 variances and off-diagonal elements are level-2 covariances. Because the random slopes for *a* and *b* covary, the point estimate of *τ*_{aj,bj} is necessary to compute the estimate of the indirect effect.

Asymptotic Covariance Matrices

The covariance matrix for the fixed parameters, sometimes called the asymptotic covariance matrix, describes the variances of, and covariances among, the fixed effect parameter estimates. The following matrix represents the ACM for the five fixed effects in the previous equations.

The elements σ^{2}_{a} and σ^{2}_{b} represent the sampling variances for the *a* and *b* estimates, respectively. The element σ_{a,b} describes the covariance between the parameter estimates.

The final piece of required information comes from the ACM for the random effects. This 15×15 matrix is too large to represent here, but contains the asymptotic variances and covariances of the 15 elements of the level-2 covariance matrix. The element σ^{2}_{τaj,bj} describes the sampling variance in the covariance estimate of the slopes *a* and *b*. Or, in other words, the expected variability in the level-2 covariance between the *a _{j}* and

These pieces of information are used to simulate repeated sampling of indirect effects. The simulated estimates of the indirect effects are used to compute confidence intervals for the observed indirect effect.

For more details on how to use this calculator, see our other calculator for simpler Mediation designs.

Bauer, D. J., Preacher, K. J., & Gil, K. M. (2006). Conceptualizing and testing random indirect effects and moderated Mediation in multilevel models: New procedures and recommendations. *Psychological Methods*, *11*, 142-163.

Kenny, D. A., Korchmaros, J. D., & Bolger, N. (2003). Lower level Mediation in multilevel models. *Psychological Methods*, *8*, 115-128.

MacKinnon, D. P. (2008). *Introduction to statistical Mediation analysis*. Mahwah, NJ: Erlbaum.

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*, 99-128.

Preacher, K. J., & Selig, J. P. (2012). Advantages of Monte Carlo confidence intervals for indirect effects. *Communication Methods and Measures*, *6*, 77-98.

R Development Core Team (2005). *R: A language and environment for statistical computing*. R Foundation for Statistical Computing, Vienna, Austria. ISBN 3-900051-07-0, URL: http://www.R-project.org.

Original version posted July, 2010.