Simple intercepts, simple slopes, and regions of significance in HLM 3way interactions
Kristopher J. Preacher (Vanderbilt University)
Patrick J. Curran (University of North Carolina at Chapel Hill)
Daniel J. Bauer (University of North Carolina at Chapel Hill)
Get a printable PDF version of these instructions.
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, opensource statistical computing environment) may be obtained here: http://cran.rproject.org/.
This web page calculates simple intercepts, simple slopes, and the region of significance to facilitate the testing and probing of threeway interactions estimated in hierarchical linear regression models (HLMs). The interaction can involve any combination of dichotomous and continuous variables. This web page explores only those situations involving the interaction of two level 2 predictors of level 1 slopes. We use the general notation _{0} to define the simple intercept and _{1} to define the simple slope. We use the standard notation of Raudenbush and Bryk (2002) to define terms in each equation, and we assume that the user is knowledgeable both in the general HLM and in the testing, probing, and interpretation of interactions in multiple linear regression (e.g., Aiken & West, 1991). The following material is intended to facilitate the calculation of the methods presented in Bauer and Curran (2004) and Curran, Bauer, and Willoughby (in press), and we recommend consulting these papers for further details, as well as our companion web page on 2way interactions in HLM.
The case we consider here involves one predictor at level 1 and a twoway interaction estimated at level 2. This can be seen as an extension of what is sometimes referred to as a slopes as outcomes model. Using the twolevel notation system of Raudenbush and Bryk (2002), the level 1 equation is expressed as
(1) 
where y_{ij} is the observed value of outcome y for observation i nested within group j, _{0j} is the intercept for group j, _{1j} is the regression slope of y on x within group j, and r_{ij} is the person and group specific residual. These regression coefficients can then be modeled as a function of two level 2 covariates (w_{1j} and w_{2j}) and their interaction (w_{1j}w_{2j}) such that
(2) 
where, for the equation predicting individual differences in intercepts, _{00} is the fixed intercept, _{01}, _{02}, and _{03} are the fixed regression coefficients for the two main effects and the level 2 interaction, respectively, and u_{0j} is the level 2 residual. Similarly, for the equation predicting individual differences in level 1 slopes, _{10} is the fixed intercept, _{11}, _{12}, and _{13} are the fixed regression coefficients for the two main effects and the interaction, respectively, and u_{1j} is the level 2 residual. Finally, the level 2 equations can be substituted into the level 1 equation to form the reduced form equation such that
(3) 
It can be seen that the regression of the level 1 slope on the level 2 covariates (and their product) results in a crosslevel interaction among x_{1ij}, w_{1j}, and w_{2j} with regression coefficient _{13}.
Following the methods described in Bauer and Curran (2004), we can define the conditional regression of y on x (denoted the focal predictor) as a function of w_{1} and w_{2} (denoted the moderators). Note that this distinction between focal predictor and moderators is arbitrary given the symmetry of the interaction. Rearrangement of the expected value of the reduced form equation, conditioned on w_{1} and w_{2}, results in
(4) 
where _{yw1w2} denotes the model implied mean value of y as a function of x at specific values of w_{1} and w_{2}, and where the simple intercept and simple slope for the conditional regression of y on x as a function of w_{1}, w_{2}, and their interaction are given by the first and second parenthetical expression, respectively. The sample estimates of these compound effects can be explicitly defined as
(5) 
where
(6) 
The sample estimates of the simple intercept (_{0}) and simple slope (_{1}) define the conditional regression of y on x as a function of w_{1}, w_{2}, and their interaction. Because these are sample estimates, we must compute standard errors to conduct inferential tests of these effects. The computation of these standard errors is one of the key purposes of our calculator.
We are primarily interested in the estimation of the simple intercept (_{0}) and the simple slope (_{1}) of the conditional regression of the outcome on the focal predictor as a function of the moderators. We now turn to a brief description of the values that can be calculated using our table below.
The first available output is the region of significance of the simple slope describing the relation between the outcome y and the focal predictor x as a function of level 2 moderators w_{1} and w_{2}. We do not provide the region of significance for the simple intercept given that this is rarely of interest in practice. The region of significance defines the specific values of the moderator at which the slope of the regression of y on the focal predictor transitions from nonsignificance to significance. Although this region can be easily obtained when testing a twoway interaction, these are much more complex to compute for a threeway interaction (see Curran, Bauer, & Willoughby, in press for further details). As is proposed in Curran et al. (in press), the table allows for the calculation of the region of significance of the regression of y on x across values of w_{1} at a particular value of w_{2}. This is a melding of the simple slopes and region approach. There are lower and upper bounds to the region. In many cases, the regression of y on the focal predictor is significant at values of the moderator that are less than the lower bound and greater than the upper bound, and the regression is nonsignificant at values of the moderator falling within the region. However, there are some cases in which the opposite holds (e.g., the significant slopes fall within the region). Consequently, the output will explicitly denote how the region should be defined in terms of the significance and nonsignificance of the simple slopes. There are also instances in which the region cannot be mathematically obtained, and an error is displayed if this occurs for a given application. However, this region is calculated for a specific conditional value of w_{2}. The region can be recalculated at several different conditional values of w_{2} (e.g., ±1SD) to gain a better understanding of the structure of the threeway interaction. By default, the region is calculated at = .05, but this may be changed by the user. Finally, the point estimates and standard errors of both the simple intercepts and the simple slopes are automatically calculated precisely at the lower and upper bounds of the region.
Simple Intercepts and Simple Slopes
. The second available output is the calculation of point estimates and standard errors for up to two simple intercepts and simple slopes of the regression of y on the focal predictor at specific levels of the moderators. In the table we refer to these specific values of the moderators as conditional values. We can choose from a variety of potential conditional values of w_{1} and w_{2} for the computation of the simple intercepts and slopes. If w_{1} or w_{2} is dichotomous, we could select conditional values of 0 and 1 to compute the regression of y on x within group 0 and group 1. If w_{1} or w_{2} is continuous, we might select conditional values that are one standard deviation above the mean of w_{1} or w_{2} and one standard deviation below the mean of w_{1} or w_{2}. Whatever the conditional values chosen, these specific values are entered in the sections labeled "Conditional Values of w_{1}" and "Conditional Values of w_{2}," and this will provide the corresponding simple slopes of y on x at those values of w_{1} and w_{2}. The calculation of simple intercepts and slopes at specific values of the moderator is optional; the user may leave any or all of the conditional value fields blank.Simple intercepts, simple slopes, and the region of significance can be obtained by following these six steps. Use as many significant digits as possible for optimal precision.
Once all of the necessary information is entered into the table, click "Calculate." The status box will identify any errors that might have been encountered. If no errors are found, the results will be presented in the output window. Although the results in the output window cannot be saved, the contents can be copied and pasted into any word processor for printing.
R Code for Creating Simple Slopes Plot
Below the output window are two additional windows. If conditional values of x_{1} (Points to Plot) and w_{1}, as well as at least one conditional value of w_{2}, are entered, clicking on "Calculate" will also generate R code for producing a plot of the interaction between x_{1} and w_{1} at the lowest value of w_{2} (R is a statistical computing language). This R code can be submitted to a remote Rweb server by clicking on "Submit above to Rweb." A new window will open containing a plot of the interaction effect. The user may make any desired changes to the generated code before submitting, but changes are not necessary to obtain a basic plot. Indeed, this window can be used as an allpurpose interface for R.
R Code for Creating Confidence Bands / Regions of Significance Plot
Assuming enough information is entered into the interactive table, the second output window below the table will include R syntax for generating confidence bands, continuously plotted confidence intervals for simple slopes corresponding to all conditional values of the moderator. The xaxis of the resulting plot will represent conditional values of the moderator, and the yaxis represents values of the simple slope of y regressed on the focal predictor.
If the moderator w_{1} is dichotomous, only two values along the xaxis (corresponding to the codes used for grouping) would be interpretable. Therefore, in cases where the focal predictor x_{1} is continuous and the moderator w_{1} is dichotomous, we suggest treating w_{1} as the moderator for the simple slopes plot (so that each line will represent the regression of y on x_{1} at conditional values of the moderator) and treating x_{1} as the moderator for the confidence bands / regions of significance plot (so that the xaxis will represent values of the focal predictor and the yaxis will represent the group difference in y at conditional values of the focal predictor). This will require switching the roles of the focal predictor and the moderator in the interactive table, requiring the entry of some new values from the ACOV matrix and reentering old values in new places.
Regardless of what variable is treated as the moderator, the user is expected to supply lower and upper values for the moderator (10 and +10 by default). As above, this R code can be submitted to a remote Rweb server by clicking on "Submit above to Rweb." A new window will open containing a plot of confidence bands.
x_{1}: focal predictor; w_{1} and w_{2}: moderators

Bauer, D. J., & Curran, P. J. (2005). Probing interactions in fixed and multilevel regression: Inferential and graphical techniques. Multivariate Behavioral Research, 40, 373400.
Curran, P. J., Bauer, D. J, & Willoughby, M. T. (2006). Testing and probing interactions in hierarchical linear growth models. In C. S. Bergeman & S. M. Boker (Eds.), The Notre Dame Series on Quantitative Methodology, Volume 1: Methodological issues in aging research (pp. 99129). Mahwah, NJ: Lawrence Erlbaum Associates.
Preacher, K. J., Curran, P. J., & Bauer, D. J. (2006). Computational tools for probing interaction effects in multiple linear regression, multilevel modeling, and latent curve analysis. Journal of Educational and Behavioral Statistics, 31, 437448.
Original version posted September, 2003. Free JavaScripts provided by The JavaScript Source and John C. Pezzullo.