Abstract
Interaction plots are used frequently in psychology research to make inferences about moderation hypotheses. A common method of analyzing and displaying interactions is to create simple-slopes or marginal-effects plots using standard software programs. However, these plots omit features that are essential to both graphic integrity and statistical inference. For example, they often do not display all quantities of interest, omit information about uncertainty, or do not show the observed data underlying an interaction, and failure to include these features undermines the strength of the inferences that may be drawn from such displays. Here, we review the strengths and limitations of present practices in analyzing and visualizing interaction effects in psychology. We provide simulated examples of the conditions under which visual displays may lead to inappropriate inferences and introduce open-source software that provides optimized utilities for analyzing and visualizing interactions.
Keywords
Moderation hypotheses are common in psychological research. For instance, researchers often test whether a given effect differs across groups, such as gender or racial groups, or examine how environmental or individual difference factors such as adversity or biological traits modify risk indicators of psychopathology (e.g., Luthar, Cicchetti, & Becker, 2000). In ordinary least squares (OLS) regression, moderation is tested by including a linear interaction term (e.g.,
To date, considerable work has offered guidelines on statistical improvements for testing and interpreting interactions (e.g., Brambor, Clark, & Golder, 2006). For instance, it is now common practice for researchers to mean-center continuous
However, considerably less attention has been devoted to providing recommendations for the substantive evaluation of interactions, which may have implications for conclusions regarding competing theoretical claims (see, e.g., Berry, Golder, & Milton, 2012; Roisman et al., 2012). For instance, in developmental psychopathology, some researchers have proposed a diathesis-stress model (Monroe & Simons, 1991). This model posits that individuals with a vulnerability (e.g., difficult temperament) fare worse than those without the vulnerability when exposed to environmental stressors (such as poor parenting), but may look no different from their nonvulnerable peers in low-stress conditions. An alternative theory proposes that these same vulnerabilities can also help children thrive in protective environments (Ellis & Boyce, 2008). These theories imply two different forms of an interaction, and determining whether the data support one theory or the other depends on how researchers evaluate the nature of the interaction. Roisman et al. (2012) highlighted analytic and visual approaches that can help determine which hypothesis is better supported by the data, such as visual inspection of interaction plots, regions-of-significance analyses, and tests of nonlinear (e.g., quadratic) effects, among others. In this article, we aim to provide similar recommendations for social science more generally, to improve scientific inference for evaluating moderated effects.
The goal of this article is to demonstrate how theoretical inference in tests of moderation can be improved by improving visual displays. A major aim in the social sciences is to increase transparency of the scientific process to ensure rigor and replicability (Cumming, 2014). Visual displays can substantially aid in attaining this goal. Displays provide efficient and nuanced information about univariate and multivariate relations in data that may not be readily apparent from tables or text descriptions of results. They also help identify misspecified models and influential data points (e.g., outliers) and facilitate how key analytic findings are communicated between researchers and their audiences (Tay, Parrigon, Huang, & LeBreton, 2016). Optimizing the visual display of interactions can thus improve the scientific rigor of moderation tests.
The Utility of Interaction Displays
Why are visual displays important for evaluating moderated effects? First, interpreting interaction coefficients is not necessarily easy or straightforward (see also Dawson, 2014; Preacher et al., 2006). Consider the following multiple regression equation with a single two-way interaction term: 1
Output from a regression analysis (assuming continuous and standardized predictors) might provide us with the following (Example 1), which shows coefficient estimates in place of the
For applied researchers, the interpretation of
When
Instead, we suggest that researchers use visual displays to aid themselves and readers in making inferences about moderation hypotheses. Figure 1 illustrates three different forms of interaction, each of which may support different theories about how the interplay between two factors influences an outcome (see also Luthar et al., 2000; Roisman et al., 2012). Figure 1a illustrates a

Standard visual displays illustrating (a) synergistic, (b) buffering, and (c) antagonistic interactions.
However, these displays lack a number of core features that are key to both effective communication and statistical integrity (G. King, Tomz, & Wittenberg, 2000; Tufte, 2001). First, these plots limit the number of displayed quantities of substantive interest, in that they communicate only the values of
Here, we first review present practices for the visual display of interactions in psychology and describe the strengths and limitations of these approaches. We then describe an open-source software utility that allows users to apply several graphic solutions that address these limitations.
Disclosures
All simulation code, simulated data, and code for creating the key figures in this article, as well as source code and instructions for using the Web utility described, are available online in a GitHub repository (https://github.com/connorjmccabe/InterActive). Code for generating the simulated examples used in this article and the simulated data can be found at https://github.com/connorjmccabe/InterActive/tree/master/Simulated%20Data. Code for reproducing the key figures can be found at https://github.com/connorjmccabe/InterActive/tree/master/Manuscript%20Figures%20Code. Source code for the Web utility, called interActive, introduced in this manuscript can be found at https://github.com/connorjmccabe/InterActive/blob/master/interActive_OLS.R.
Present Practices
The simple-slopes approach
The most common method for probing interaction effects is simple-slopes analysis, typically conducted using the pick-a-point approach (Aiken & West, 1991). In the pick-a-point approach, researchers select values of interest of the moderator variable (
Simulated Results of a Synergistic Interaction Probed Using the Pick-a-Point Approach (
Note:
Figure 2 provides a simple-slopes plot for Example 1, based on the simulated results in Table 1. Plots like this one can be created with software programs such as Excel (e.g., Dawson, 2014), either by using coefficients derived using the pick-a-point approach or by computing simple slopes based on coefficient estimates from the original model. By default, plots are typically constructed displaying the effect at 1

A simple-slopes plot of the simulated
Simple-slopes plots are limited in several ways. First, they often do not represent the full nature of an interaction effect because they typically display the data only at 1
A crossover point may provide evidence that an interaction is disordinal. However,
Range restriction in moderator variables is also a concern. Displaying an interaction at several levels of a continuous moderator does not necessarily describe the full nature of an interaction across all relevant levels of that moderator. This limitation may be especially important when the significance or direction of the simple-slopes effect changes at more extreme levels of the moderator. For example, if a moderator is skewed or if a sample is particularly large, there may be a substantial number of participants represented at values higher than 1
Plots of simple slopes typically show only the simple-slopes estimates, with little direct indication of the uncertainty in the estimates or whether the slopes differed significantly from zero. Showing the uncertainty in simple slopes would provide a depiction of how precisely each effect was estimated, which is influenced by factors such as sample size. For instance, Figure 3a displays simple slopes and confidence regions associated with the predicted values of

Illustration of the effect of sample size on uncertainty in simple-slopes estimates: simple slopes with 95% confidence regions for (a) the simulated example in Table 1 (
Finally, most simple-slopes plots do not display the observed data. This omission prevents the use of these plots to diagnose whether the interaction effect is appropriately specified (e.g., Tay et al., 2016) or whether the simple slopes selected represent actual data. For instance, Figure 4 displays three scenarios for Example 1 in which the observed data for the predictor variables were simulated from different population distributions (

Illustration of the impact of nonnormality on the interpretation of simple slopes. The three scatterplots show regression lines and observed data for the
The marginal-effects approach
Marginal-effects (or regions-of-significance) plots (e.g., Berry et al., 2012; Preacher et al., 2006) are commonly used in combination with the J-N analytic approach to interactions. These plots depict the simple-slope coefficient of the focal variable and its 95% confidence region against values of the moderator. They indicate the significance, uncertainty, magnitude, and direction of the simple slope across a full hypothetical range of the moderator variable, often a range from 3

A marginal-effects (or regions-of-significance) plot of Example 1. The plot shows the marginal effect of
Although marginal-effects plots aid in detecting and communicating interaction effects that may otherwise be missed, they fail to indicate whether or how much data are represented within the graphed regions and therefore may suggest effects that are not (or are very minimally) supported by the data. For instance, in the data from Example 1, very few data points are observed when
Moreover, despite their utility, marginal-effects plots have been provided less often than simple-slopes plots in publications reporting tests of moderation. For instance, we randomly sampled 50 of the 253 articles that were published in 2016 and cited the article in which Preacher et al. (2006) described the use of the J-N technique and marginal-effects plots. In brief, of these 50 articles, 38 (76%) provided a simple-slopes plot at two or more levels of the moderator to supplement their analyses. Only 10 (20%) made any mention of conducting a regions-of-significance analysis, and only 4 (8%) provided a marginal-effects plot depicting regions-of-significance results. In other words, among a sample of 50 publications citing a seminal manuscript describing the use of marginal-effects plots, only 8% actually used that kind of display in their article, and 76% used a less descriptive display. These results illustrate a substantial gap between the development of an advanced approach to analysis and its implementation.
We suspect that the unintuitive nature of marginal-effects plots has limited their widespread adoption. Marginal-effects plots are ultimately used to understand the range of a moderator for which a focal predictor is statistically significantly associated with an outcome (as well as the degree of uncertainty in the association); thus, this information is somewhat redundant with information provided by a text description of results obtained using the J-N technique. Moreover, readers are mostly interested in using displays to infer the predicted value of the dependent variable at meaningful values of
Summary of present practices
Visual displays of interactions can substantially improve inferences, communication, and transparency, and also can help in diagnosing problems in data analysis. Although simple-slopes and marginal-effects plots strengthen the interpretation of moderation analyses in some ways, they have several limitations. In the next section, we describe an approach to create displays of interactions that utilize the strengths of present practices and address the concerns we have highlighted in our critiques.
Improving the Visual Display of Interactions: interActive
We created an open-source analysis and data-visualization application that builds on simple-slopes and marginal-effects plots to display all quantities of interest, uncertainty in the displayed estimates, and the data underlying an interaction (https://connorjmccabe.shinyapps.io/interactive/). We created this application, called interActive, using the freely available statistical program R (R Development Core Team, 2016) in the Shiny Web application framework (Chang, Cheng, Allaire, Xie, & McPherson, 2017). The graphics were created using the ggplot2 graphics package (Wickham, 2009). The interActive application provides data-upload functionality and allows users to specify and analyze OLS regression models with two-way interaction effects. The present functionality allows for either continuous linear or quadratic focal predictors and either continuous or binary categorical moderator predictors. The application accommodates the specification of covariates (i.e., control variables) and was designed to be usable by researchers at all levels of quantitative expertise. It can be used to conduct regions-of-significance analyses for interactions of continuous variables and creates marginal-effects plots of the results, with marginal rugs indicating observed data (e.g., Fig. 5).
The interActive application is based on the concept of small multiples (Tufte, 2001). An individual plot is created for each of several simple slopes (e.g., Fig. 6). This facilitates the display of a broad range of simple-slope effects, observed data, and measures of uncertainty. Because the design of all plots is identical except for the level of the moderator, a viewer’s attention is directed toward the change in pattern across multiples, which enables the viewer to understand the nature of the interaction depicted. Using small multiples allows indicators of observed data and measurement uncertainty to be included in each plot. Additionally, users can specify the level of the moderator for each multiple. This provides users with flexibility in deciding the number of levels of the moderator and the specific values of the moderator at which they will probe the interaction, so as to best characterize the observed data.

Illustration of small multiples created by interActive for Example 1 using multivariate normal predictors. Simple slopes are provided for levels of the moderator 2
The functionality of interActive is leveraged to display the observed data that are most representative of each simple slope. For each small multiple representing a given moderator value, the displayed data points reflect the bivariate relation between the focal predictor and the dependent variable. This relation is shown within a range of the moderator that begins at half the distance from the value of the moderator at the next lower multiple and ends at half the distance from the value of the moderator at the next higher multiple. For instance, in a series of multiples depicting simple slopes at −1, −0.5, 0, +1, and +2 standardized units from the mean of the moderator, the −1-
We implemented additional design choices to allow for more nuanced evaluation of the depicted effect. For instance, interActive specifies the limits of the
For each simple slope, interActive computes the 95% CI for the predicted value of
and
where
Appendix A provides an example of the computation of the confidence interval for a predicted value in a bivariate case. Equivalently, and perhaps more intuitively for many researchers, this interval can also be understood as the 95% CI of the intercept in a regression model, and one could center the focal predictor around different values to derive points that follow the edges of the confidence region. Table 2 and Figure 7 illustrate this point in a bivariate case using Example 1. Note that in the standard regression output provided in Table 2, the intercept value when
Simulated Results of a Bivariate Regression With the Predictor Centered at Different Values (
Note: The intercept values differ across transformations of

Plot of the bivariate relation between
The interActive plot in Figure 6 was simulated from Example 1 using multivariate normal predictors. Note that this display provides much of the same information found in Table 1 (e.g., estimates of slopes, intercepts, and confidence) while also showing more thoroughly how well the model represents the data. Figure 8a displays corresponding estimates simulated from exponentially distributed predictors. Note that the plot elements added by interActive make it readily apparent that the data are not well represented by these graphs; they suggest that the researcher should consider values of the moderator that are more representative of the data (e.g., Fig. 8b). Appendix B provides an example of how interActive can enhance understanding of an interaction effect observed in real data.

Small multiples created by interActive for Example 1 in a simulation with exponentially distributed predictors. In (a), simple slopes are provided for levels of the moderator 2
Discussion
We have reviewed current practices for graphically displaying interaction effects and provided tools and guidelines for improving displays to affirm and communicate statistical results of moderation analyses. We have included simulated examples showing the conditions under which improper visual displays can affect inference and have shown how the interActive application can be used to address these concerns. To facilitate understanding of the full nature of interaction effects, we recommend the J-N technique and marginal-effects plots as standard analytic strategies for probing interactions of continuous variables across the full range of the moderator (Preacher et al., 2006; Roisman et al., 2012). We also encourage researchers to continue providing displays of simple-slopes effects to communicate the substantive nature of interactions and to construct these displays bearing in mind the principles of graphic integrity we have described here. These practices will support the validity of inferences made while also communicating them with appropriate precision and clarity. When advances in both statistical and graphic approaches are employed, researchers and readers alike can evaluate the nature of an interaction effect with greater understanding and confidence.
We consider the practices we have described to be a first step toward improving visual displays of interactions. For instance, we aim to extend these practices to displaying interactions in nonlinear models given that interpreting simple effects is even less straightforward in nonlinear than in linear cases (Ai & Norton, 2003; Karaca-Mandic, Norton, & Dowd, 2012). Similarly, these principles should also be extended to interactions in structural equation and multilevel modeling (Preacher et al., 2006). We hope that educators, editors, and researchers will use the interActive application and the principles we have detailed to improve understanding and methodological rigor in moderation analyses. We urge researchers to consider data visualization as a crucial (rather than auxiliary) step in the scientific process.
Supplemental Material
McCabeOpenPracticesDisclosure – Supplemental material for Improving Present Practices in the Visual Display of Interactions
Supplemental material, McCabeOpenPracticesDisclosure for Improving Present Practices in the Visual Display of Interactions by Connor J. McCabe, Dale S. Kim and Kevin M. King in Advances in Methods and Practices in Psychological Science
Footnotes
Appendix A: Computing the Confidence Interval of a Predicted Value of a Dependent Variable
In this appendix, we illustrate how to compute an estimate and 95% confidence region for
Assume the following data:
We are regressing
In matrix form, this can be equivalently understood as
where
Suppose we arrange our predictor variable into a 5 × 2 matrix
We can then create a row of hypothetical values of our predictor to obtain the value and 95% confidence interval of
where the first row of this vector is a placeholder value of
The formula for the standard error of this estimate (Equation 3) is
Obtaining the inverse of the inner product (
Once this matrix is computed, we can apply this quantity to our formula, in concert with the values of
Given
These results suggest that when
The R code for recreating these computations and generating a plot depicting these values is available at https://github.com/connorjmccabe/InterActive/blob/master/Appendix%20A%20code/AppendixA_code.R.
Appendix B: Example of Using interActive With Real Data
Here we illustrate how using interActive to depict a previously reported interaction effect can enhance interpretation of the data. The example is drawn from a study of 491 young adults who were undergraduate students in the Pacific Northwest region of the United States. The study examined whether the effect of sensation seeking on the frequency of alcohol-related problems differed across levels of alcohol use (see K. M. King, Karyadi, Luk, & Patock-Peckham, 2011, for more details). Note that the original authors used semicontinuous regression given that the outcome variable was zero inflated and overdispersed, and violated ordinary least squares (OLS) assumptions. Therefore, in this example, we use parametric bootstrapping to simulate a new conditionally normal alcohol-problems variable that was based on an OLS model from the original data. Moreover, we do not include the covariates included in the original report because these variables were unavailable in the current data set. Nonetheless, the estimate of the interaction effect we obtained (
Figure B1a is an adaptation of the simple-slopes display from the original article. In this graphic, the slope for the effect of sensation seeking on alcohol-related problems was plotted at low (1
Using this graphic alone, one might infer that the effect of sensation seeking on alcohol-related problems reverses depending on how much one drinks. That is, sensation seeking appears to be protective when use is low and a risk factor when use is high, and it may or may not be associated with alcohol-related problems when use is at average levels. This effect is ostensibly supported by a regions-of-significance analysis: The slope of the effect of sensation seeking on alcohol-related problems is significant and negative when alcohol use is approximately 2.15
Although the effects presented using interActive’s small multiples (see Fig. B2) are similar to those depicted in Figure B1a, more nuanced information about these effects is available from the small multiples because they include confidence regions and more simple slopes and also display the observed data. For instance, as does Figure B1a, Figure B2 indicates that greater alcohol use is associated with more negative alcohol consequences and that the effect of sensation seeking on alcohol-related problems becomes stronger at higher levels of use. Also, as in the case of Figure B1a, the simple slopes provided can be used to determine the predicted level of alcohol-related problems conditional on specific values of sensation seeking and alcohol use. But in the case of Figure B2, predictions across a greater range of conditional values are possible because the
The added elements in the display also increase the transparency of the data and clarify the inferences that can be made from the results. For instance, though J-N analyses indicated a significant protective effect of sensation seeking when alcohol use was 2.15
In summary, Figure B2a suggests a substantively different conclusion compared with the graphics in Figure B1. Whereas the plots in Figure B1 suggest that sensation seeking was protective against alcohol-related problems at low levels of alcohol use, the revised graphic shows that this inference is in fact unsupported. Instead, they suggest that the effect of sensation seeking on alcohol-related problems is not significantly different from zero at mean levels of alcohol use or lower, but is significant and positive at both 1 and 2
Action Editor
Pamela Davis-Kean served as action editor for this article.
Author Contributions
C. J. McCabe generated the idea for the study. C. J. McCabe programmed the interActive application and created code for all the figures, and D. S. Kim verified the accuracy of the code. C. J. McCabe and K. M. King jointly created simulation code for the manuscript. C. J. McCabe wrote the first draft of the manuscript, and all the authors edited the manuscript. K. M. King and D. S. Kim provided feedback on the functionality and usability of the application. All the authors approved the final version of the submitted manuscript.
Declaration of Conflicting Interests
The author(s) declared that there were no conflicts of interest with respect to the authorship or the publication of this article.
Funding
This research was partially supported by a grant from the National Institute on Drug Abuse (DA040376) to C. J. McCabe. The content of this article is solely the responsibility of the authors and does not necessarily represent the official views of the funding agency.
Open Practices
All data and materials have been made publicly available via GitHub and can be accessed at https://github.com/connorjmccabe/InterActive. The complete Open Practices Disclosure for this article can be found at http://journals.sagepub.com/doi/suppl/10.1177/2515245917746792. This article has received badges for Open Data and Open Materials. More information about the Open Practices badges can be found at
.
Notes
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
