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/.
This web page calculates simple intercepts, simple slopes, and the region of significance to facilitate the testing and probing of three-way 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 2-way interactions in HLM.
The case we consider here involves one predictor at level 1 and a two-way 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 two-level notation system of Raudenbush and Bryk (2002), the level 1 equation is expressed as
where yij 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 rij is the person and group specific residual. These regression coefficients can then be modeled as a function of two level 2 covariates (w1j and w2j) and their interaction (w1jw2j) such that
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 u0j 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 u1j 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
It can be seen that the regression of the level 1 slope on the level 2 covariates (and their product) results in a cross-level interaction among x1ij, w1j, and w2j 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 w1 and w2 (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 w1 and w2, results in
where y|w1w2 denotes the model implied mean value of y as a function of x at specific values of w1 and w2, and where the simple intercept and simple slope for the conditional regression of y on x as a function of w1, w2, 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
The sample estimates of the simple intercept (0) and simple slope (1) define the conditional regression of y on x as a function of w1, w2, 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 w1 and w2. 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 non-significance to significance. Although this region can be easily obtained when testing a two-way interaction, these are much more complex to compute for a three-way 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 w1 at a particular value of w2. 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 non-significant 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 non-significance 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 w2. The region can be re-calculated at several different conditional values of w2 (e.g., ±1SD) to gain a better understanding of the structure of the three-way 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, 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.
Below the output window are two additional windows. If conditional values of x1 (Points to Plot) and w1, as well as at least one conditional value of w2, are entered, clicking on "Calculate" will also generate R code for producing a plot of the interaction between x1 and w1 at the lowest value of w2 (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 all-purpose interface for R.
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 x-axis of the resulting plot will represent conditional values of the moderator, and the y-axis represents values of the simple slope of y regressed on the focal predictor.
If the moderator w1 is dichotomous, only two values along the x-axis (corresponding to the codes used for grouping) would be interpretable. Therefore, in cases where the focal predictor x1 is continuous and the moderator w1 is dichotomous, we suggest treating w1 as the moderator for the simple slopes plot (so that each line will represent the regression of y on x1 at conditional values of the moderator) and treating x1 as the moderator for the confidence bands / regions of significance plot (so that the x-axis will represent values of the focal predictor and the y-axis 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 re-entering 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.
Bauer, D. J., & Curran, P. J. (2005). Probing interactions in fixed and multilevel regression: Inferential and graphical techniques. Multivariate Behavioral Research, 40, 373-400.
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. 99-129). 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, 437-448.