cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • We’re improving the Learn JMP page, and want your feedback! Take the survey
  • JMP monthly Newswire gives user tips and learning events. Subscribe
Choose Language Hide Translation Bar
Digging deep into interactions with the Moderation and Mediation Add-In for JMP Pro

The Moderation and Mediation Add-In for JMP Pro makes it easy to use methodologies that are popular among social scientists (like me!). But these methodologies can be useful in other settings, too. In this blog post, I use chemical purity data to demonstrate how to fit and visualize a model with an interaction using the add-in. The add-in automates model specification and fitting, and produces detailed numeric and graphical output about the interaction.

 

The example

We often need to model interactions to understand how multiple predictors work together to affect an outcome. When the effect of one predictor is dependent upon the level of another predictor, it is widely referred to as an interaction. (In the social sciences, it's called moderation.) 

In this example, we model chemical purity as a function of catalyst concentration and temperature. In our data, there is an interaction between catalyst concentration and temperature. In other words, catalyst concentration is related to chemical purity, but only under certain temperature conditions – i.e., when temperature is particularly high or low. In social science speak, we would say that “temperature moderates the effect of catalyst concentration on chemical purity.”

Using the Moderation model in the add-in, we can follow up on this result and get more detail about the interaction. Catalyst concentration is the predictor (X), temperature is the moderator (Z), and purity is the outcome (Y).

 

A quick primer on predictive versus explanatory modeling

You may be wondering how we arrived at this model. How do we know there’s an interaction between catalyst concentration and temperature? We’ll assume that there is some sort of previously obtained evidence that led us to this model. Maybe we’ve conducted a prior analysis, such as regression with variable selection, that indicated this interaction is important. Maybe we have other evidence or knowledge that leads us to expect this is an important interaction.  

The focus of this add-in is explanation, rather than prediction. In predictive modeling, our goal is to predict an outcome as accurately as possible, so we focus on measures of prediction accuracy like R2 or RMSE. In explanatory modeling, our goal is to understand why, how, and when our predictors relate to the outcome – so rather than focusing on prediction accuracy, we focus on specific coefficients.  

Because it was designed for explanation rather than prediction, the add-in does not enable inclusion of many interactions in order to find an important one. Rather, it assumes we’ve already found it, or that we’ve formed a hypothesis that leads us to expect a certain interaction. Therefore, we specify just one interaction that we want to dig deeper into.

 

Fitting the model

Click here to download the add-in and the data for this example (purityData_moderation.csv). The add-in requires JMP Pro 16 or later. The add-in enables easy fitting and visualization of interactions (moderation), as well as interactions within causal pathways (moderated mediation). See this blog post for more details about these models.

To run our example model, go to Add-Ins > Moderation and Mediation > Moderation. In the launch window, place variables in their respective roles. Catalyst concentration is the predictor (X), temperature is the moderator (Z), and purity is the outcome (Y). If needed, we could also add any number of covariates to the model (i.e., additional predictors not involved in the interaction). If our model has additional interactions that also need to be controlled for, we could add them here, too, but we'd need to create the appropriate product terms ahead of time. For this example, check the “Turn off centering” box and click OK.

haleyyaremych_0-1746024654748.png

 

The add-in fits models using the Structural Equation Modeling (SEM) platform in JMP Pro. Therefore, we first see output from the SEM platform, including parameter estimates and R2 for the outcome, purity.

haleyyaremych_1-1746024687277.png

 

Numeric details about the interaction

The Moderation Details section gives us detailed numeric output regarding the interaction between catalyst concentration and temperature. First, under Statistical Significance, we see that temperature significantly moderates the relationship between catalyst concentration and purity. (In other words, there is a significant interaction between temperature and catalyst concentration.)

haleyyaremych_2-1746024745700.png

Next is Simple Slopes. A simple slope is the effect of X on Y at a particular value of Z. Here, we see the effect of catalyst concentration on purity at three temperatures: low (1SD below the mean), average (mean), and high (1SD above the mean). When temperature is low, catalyst concentration has a strong, positive, statistically significant effect on chemical purity. When temperature is at its average, the effect of catalyst concentration is weaker, but is still statistically significant. When temperature is high, the effect of catalyst concentration is weak and no longer significant. This output shows that catalyst concentration significantly affects chemical purity only when temperature is not too high. But how high is too high?

We can answer this question with the Johnson-Neyman (JN) technique. It produces significance boundaries, which are the exact temperatures at which the effect of catalyst concentration on purity goes from being statistically significant to nonsignificant. The significance boundaries are ~24 degrees and ~101 degrees, and the effect of the catalyst is significant outside these boundaries (i.e., <24 and >101). We’ll ignore the 101 boundary to avoid extrapolation, since temperatures in our data set range from -4 to 48 degrees. So, when temperature is <24 degrees, the effect of catalyst concentration on purity is significant. When temperature is >24 degrees, the effect of catalyst concentration on purity is no longer significant. In other words, catalyst concentration significantly affects chemical purity, but only when temperature is less than 24 degrees.

Due to this very specific numeric output that it provides, the JN technique is considered the state-of-the art method for understanding interactions in social science.

 

Visualizing the interaction with graphs

The JN Plot displays all of the above numeric information in a unique graph. The x-axis is temperature (the moderator) and the y-axis is the simple slope of catalyst concentration on purity. As temperature increases, the effect of catalyst concentration on purity decreases. When temperature reaches 24 degrees (the significance boundary), the effect of catalyst concentration on purity is no longer significant, which is depicted by the confidence band turning from blue to red. In addition to displaying the significance boundary, another nice feature is that the JN Plot displays the effect of catalyst concentration on purity at all observed values of temperature, along with its confidence band.

haleyyaremych_3-1746024813199.png

The JN plot can be tough to get used to because it displays simple slopes on the y-axis. To make this plot easier to digest, I added graphlets! Hover over the line to view a simple slopes plot that displays the relationship between catalyst concentration and purity at that particular temperature.

haleyyaremych_4-1746024851454.png

haleyyaremych_5-1746024865503.png

haleyyaremych_6-1746024880985.png

 

Finally, the Simple Slopes Plot creates a static graph of the relationship between catalyst concentration and chemical purity at three temperatures.

haleyyaremych_7-1746024901571.png

 

Closing thoughts: Isn’t this just regression?

You may have noticed that this example is simply a multiple regression model with an interaction term (and you’re right, it is!). Indeed, using Standard Least Squares in Fit Model, we could fit a mathematically equivalent model. The add-in uses SEM, but in some cases like this one, where all variables are directly observed, SEM is equivalent to classic multiple regression.

If we used Fit Model, we could even use the Profiler to visualize how the effect of catalyst concentration changes as temperature changes. So, why bother using the add-in? Here are some points to consider.

haleyyaremych_8-1746024961900.png

  • The add-in provides more numeric and graphical output about the interaction because its goal is in-depth explanation rather than prediction. For example, we get more detail about simple slopes and their significance. The Profiler enables us to visualize simple slopes, whereas the add-in produces their values, standard errors, and statistical significance.
  • JN output is not available elsewhere in JMP and provides the richest information about the interaction. For example, significance boundaries tell us the exact temperatures at which catalyst concentration has a significant and nonsignificant effect on purity. JN quantities and plots cannot be obtained via Fit Model or the Profiler.
  • Since the add-in relies on the machinery of the SEM platform, missing data are handled with cutting-edge methods.
  • The add-in also enables us to examine interactions that occur within causal pathways (moderated mediation). These types of models can be fit only with SEM. This post did not discuss interactions within causal pathways, but examples can be found in this blog post.

 

If your goal is to dig deeper into an interaction, then the Moderation and Mediation Add-In may be a useful tool.

Click here to download the add-in and the example data set (purityData_moderation.csv).

 

Last Modified: May 2, 2025 9:00 AM