cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Browse apps to extend the software in the new JMP Marketplace
Choose Language Hide Translation Bar
Who, what, why, and how? Tools for modeling and visualizing moderation and moderated mediation in JMP Pro

Often as we are trying to gain insights from our data, understanding that two variables are related is not enough. We need to dig deeper and ask questions like: under what circumstances are they related? For whom are they related, why are they related, and how? Moderation, mediation, and moderated mediation allow us to answer exactly these types of questions.

These analytic techniques, referred to as conditional process models (Hayes, 2022; Preacher et al., 2007), are popular and important but cumbersome to fit. Furthermore, visualizations that are essential for understanding interactions, including Johnson-Neyman plots and simple slopes plots, are difficult to create and require error-prone calculations.

The Moderation and Mediation JMP Add-In described in this post enables easy specification, fitting, and visual probing of interactions in three popular models: moderation, first-stage moderated mediation, and second-stage moderated mediation. These models can be fit with ordinary least squares or with structural equation modeling (SEM) software; the Add-In relies on SEM, which handles missing data with cutting-edge methods and enables simultaneous model estimation. (This Add-In requires JMP Pro 16.0 or later.)

The simplest way to describe these conditional process models is by using an example. Let’s consider this clip from an article in scienceofpeople.com about improving job satisfaction:

“Do you know your company’s mission? Do you know the impact of your work? When we don’t have our “why” at the front of our mind, it can be hard to feel motivated and excited about what we are doing… When we get busy or overwhelmed, the “why” just seems to slip away.”

Basic Moderation Example

Under what circumstances is meaningfulness of our work related to job satisfaction?

The above clip suggests that meaningfulness of our work is related to greater job satisfaction, but if we are too overwhelmed at work, this relation diminishes. In other words, overwhelm moderates the relationship between meaningfulness and job satisfaction (i.e., there is an interaction effect). Conceptually, we can represent this with a path diagram:

haleyyaremych_0-1658942545221.jpeg

So how do we test for this interaction effect and, if it is statistically significant, understand its meaning? The steps below outline how to do this with the Moderation and Mediation Add-in.

User Input

First, the user input window illustrates the conceptual path diagram alongside the statistical model that will be fit in the SEM platform of JMP Pro. Making the connection between these two model representations can be difficult, so this feature seeks to aid user understanding of the statistical model being fit.

All that’s required from the user is to indicate which variable takes on each role in the model: the predictor (X), the moderator (Z), and the outcome (Y). Optionally, any number of covariates can be included to control for their effects. All variables must be continuous.

All that’s required from the user is to indicate which variable takes on each role in the model: the predictor (X), the moderator (Z), and the outcome (Y).

By default, X and Z will be mean-centered. The mean-centered variables will be used to compute a product term (X*Z) for model fitting. If desired, this feature can be turned off and X and Z will remain uncentered. Furthermore, X and Z can be centered around a user-specified value.

The final section of the user input window concerns what will be shown in the output report. By default, text and plots for probing moderation will only be displayed if the interaction term (X*Z) is significant at alpha = .05. The user can opt to see these results even if the interaction term is non-significant (for example, if an alpha = .10 significance level is desired).  

haleyyaremych_1-1658942545234.png

Results

SEM Output: The first section of the output report shows results from the SEM platform, including model fit statistics, parameter estimates, a path diagram of the model, and the proportion of variance explained in the outcome. In the Path Diagram, covariances will not appear if 1 or more covariates have been included (to reduce image clutter). Covariances, and other estimates, can be displayed by right-clicking within the diagram and selecting Show > Covariances.

haleyyaremych_2-1658942545258.png

Moderation Details: This section provides succinct text explanations of results that can easily be pasted into publications or reports, including boundaries of significance calculated by the Johnson-Neyman (J-N) technique. The J-N technique calculates values of the moderator at which the simple slope of X transitions from significance to non-significance. There may be zero, one, or two significance boundaries within the observed range of the moderator. In some cases, boundaries cannot be calculated because the simple slope of X is significant or non-significant across the entire possible range of the moderator. In these cases, this information will be displayed and the J-N plot will still appear in the report.

The Moderation Details section provides succinct text explanations of results that can easily be pasted into publications or reports.

haleyyaremych_3-1658942545261.png

Interactive Johnson-Neyman Plot: The J-N plot is considered the most informative and state-of-the-art tool for visually probing interactions. Here, the moderator is on the x-axis and the simple slope relating X to Y is on the y-axis. So, we can see how the simple slope relating X to Y changes as the moderator changes. Confidence bands indicate whether the simple slope at each value of the moderator is significant (blue) or non-significant (red) at alpha = .05.

In our example, we see that meaningfulness is significantly related to job satisfaction at low-to-medium levels of overwhelm (recall the x-axis has centered values). As overwhelm increases, the association between meaningfulness to job satisfaction decreases. Indeed, the J-N plot helps us identify the precise value of overwhelm (1.75) at which this association is no longer statistically significant.

Despite all the information they provide, J-N plots can be difficult to digest because a simple slope is on the y-axis. To solve this problem, I made this plot interactive! Hover over the line to see a plot of Y vs. X at that particular value of the moderator. As you hover your mouse over different points on the line, it becomes easy to see how the relationship between X and Y changes as the moderator changes.

Hover over the line to see a plot of Y vs. X at that particular value of the moderator.

haleyyaremych_4-1658942545269.png

haleyyaremych_5-1658942545278.png

haleyyaremych_6-1658942545286.png

Simple Slopes Plot: Finally, a simple slopes plot will appear at the bottom of the report. Here, the relationship between X and Y is displayed at three values of the moderator: 1 SD below the mean, the mean, and 1 SD above the mean. This plot is not static, so feel free to alter axis titles, legend labels, or line type and color – whatever you need for your publication or report! Tip: use double-click and context menu to find these options.

haleyyaremych_7-1658942545291.png

First- and Second-Stage Moderated Mediation Examples

Why, how, and for whom is meaningfulness of our work related to job satisfaction?

For both first- and second-stage moderated mediation, the user input window and output report will look nearly identical to that of the basic moderation model. The key differences here are all about interpretation of results. Instead of simple slopes, plots will show conditional indirect effects at each value of the moderator. A conditional indirect effect is similar to a simple slope in that it depends on the value of the moderator. But now, we are describing the effect of X on Y through the mediator, M. These reports do not probe pieces of the pathway (for example, X-to-M, M-to-Y), but instead, the entire pathway from X to Y through M (i.e., the indirect effect). This entire indirect effect is moderated by Z, and is usually of greatest interest for probing and significance testing.

A couple of notes: both of these models rely on the assumption that sample size is large, because standard errors of the indirect effect are computed by normal-theory methods, not with bootstrapping. (Though look out for bootstrapping capabilities in future versions of the SEM platform in JMP Pro!) Additionally, in the first-stage model, Z is specified to moderate both the X-to-M and X-to-Y path to ensure proper model specification in the SEM platform. Moderation of the X-to-M path is typically of interest here, so results do not focus or provide detail on the moderation of the direct X-to-Y path.

First-Stage Moderated Mediation

haleyyaremych_8-1658942545294.png

In our example, overwhelm significantly moderates the pathway from meaningfulness to motivation. Therefore, the entire indirect effect from meaningfulness to job satisfaction is moderated. The indirect effect is significant when overwhelm is less than 1.63. Thus, when overwhelm is low-to-medium, finding meaning in one’s job leads to greater motivation, which in turn leads to more job satisfaction.

haleyyaremych_9-1658942545302.png

Second-Stage Moderated Mediation    

haleyyaremych_10-1658942545304.png

In this example, overwhelm significantly moderates the pathway from motivation to job satisfaction. The entire indirect effect from meaningfulness to job satisfaction is significant when overwhelm is less than 1.25. As in the previous example, when overwhelm is low-to-medium, finding meaning in one’s job leads to greater motivation, which in turn leads to more job satisfaction.

haleyyaremych_11-1658942545311.png

Replicate any of these results with the attached simulated data sets! 

 

For more detail, see:

Bauer, D. J., & Curran, P. J. (2005). Probing interactions in fixed and multilevel regression: Inferential and graphical techniques. Multivariate Behavioral Research40(3), 373-400.

Hayes, A. F. (2022). Introduction to Mediation, Moderation, and Conditional Process Analysis: A Regression-Based Approach (3rd Ed.). Guilford.

Preacher, K. J., Rucker, D. D., & Hayes, A. F. (2007). Addressing moderated mediation hypotheses: Theory, methods, and prescriptions. Multivariate Behavioral Research42(1), 185-227.

To contact me, email haley.e.yaremych@vanderbilt.edu

Last Modified: Jul 27, 2022 8:21 PM
Comments
haleyyaremych
Staff

I've gotten some questions about whether the add-in can handle a dichotomous predictor, so I will answer that here: 

 

Yes, you can use a binary predictor or moderator, but it will need to be saved as a numeric variable in your data set (not nominal) so that the add-in will recognize it as a usable variable. I would strongly recommend 0/1 coding.

 

Additionally, I would recommend against centering the binary predictor to help make your results more interpretable. Suppose X is binary: to leave X uncentered, you can either select "Turn off centering" (this way, nothing will be centered) or select "Center X around a different value" and leave 0 as the value here (this way, only the continuous variable will be centered and the binary X will remain uncentered). 

 

This applies to binary variables, but not multicategorical. Multicategorical variables will not work with this add-in.

 

Hope this helps!

Haley

jambo
Level I

Hi Haley

Thank you for your incredible work. Anyway to use this addin without using a moderator, only using a mediator to conduct a primary mediation analysis . Without the addition of the moderator the Addin seems not to work. 

best

 

LauraCS
Staff

For @jambo and others interested in mediation analysis, JMP Pro can do this through the Structural Equation Models platform:

  • Under the Analyze > Multivariate menu, you'll find "Structural Equation Models" (SEM) --click on that option and select the 3 (or more, if doing multiple mediation) variables to launch the SEM platform:

LauraCS_0-1661977928237.png

 

  • Upon launch, you'll find a "Model Shortcuts" red triangle, which has an option for fitting Mediation Models under "Cross-sectional Classics."

LauraCS_1-1661977993033.png

 

  • The shortcut will guide you to select the predictor, mediator(s), and outcome variables. Lastly, you'll click on "Run" to fit the model and get your results.

LauraCS_2-1661978085314.png

 

  • You might also want to select "Indirect Effects" under the fitted model to get estimates for indirect effects along with delta-method standard errors:

LauraCS_3-1661978154331.png

 

HTH,

~Laura

Rongyu_Kuang
Level I

Hi Laura, 

 

many thanks for such useful add-in. 

 

just a quick question about the significant boundary, my output shows that 

"The simple slope of dummy_c passes from significance to non-significance when average SE_c equals -6.459 and -0.231. The simple slope of dummy_c is significant outside of these two values." why the significant boundary is negative value (i.e., -6.459 and -0.231). the average SE  measured through 11-bipolar scales is general positive value. moreover, what does "_c" in "average SE_c" or "dummy_c" mean ? 

 

best wishes, 

Rongyu

Rongyu_Kuang
Level I

Hi Haley, 

 

many thanks for such useful add-in. 

 

just a quick question about the significant boundary, my output shows that 

"The simple slope of dummy_c passes from significance to non-significance when average SE_c equals -6.459 and -0.231. The simple slope of dummy_c is significant outside of these two values." why the significant boundary is negative value (i.e., -6.459 and -0.231). the average SE  measured through 11-bipolar scales is general positive value. moreover, what does "_c" in "average SE_c" or "dummy_c" mean ? 

 

best wishes, 

Rongyu

LauraCS
Staff

Hi @Rongyu_Kuang,

I'm glad you're finding the add-in useful!  The "_c" suffix you're seeing in the variable names is meant to convey that the variables have been mean-centered. You can control this in the launch dialog (see highlighted section in the screenshot below).

LauraCS_0-1682341999843.png

However, centering the variables (as the add-in does by default) is recommended to facilitate interpretation of parameter estimates, unless your data already have a meaningful value of zero. It sounds like one of your variables is a binary predictor (a "dummy variable"), which would already have a meaningful value of zero and therefore doesn't need to be centered. If this is indeed your case, you can check the boxes to Center X and Center Z, leave 0 for X and input the mean of Z:

 

LauraCS_1-1682343256047.png

 

Lastly, you can also bring the boundary values back to their original metric by getting the mean for SE (by clicking the main red triangle menu > Descriptive Statistics > Univariate Simple Statistics) and add it to the values -6.459 and -0.231.

LauraCS_3-1682344469684.png

 

Keep in mind that it's possible for the significance boundaries to be outside the range of the observed data. In your case, it's possible the lower boundary (SE_c equals -6.459) is outside the range of the data. To guard against extrapolation, the Johnson-Neyman Plot only displays the boundaries that are within the observed data--it also only displays confidence bands for the range of the observed data. All in all, this means that the best way to interpret your results is to look at the J-N Plot to see how the simple slope of your main predictor (X) on Y, changes as a function of Z. Hover over the points of the line to get graphlets that show a non-significant simple slope versus a significant one. You might already be doing this, but here's one example of that:

LauraCS_2-1682344398230.png

 

HTH,

~Laura

 

 

yws5055
Level I

Thanks, Laura for the detailed instructions! I'm wondering whether this can be used when X or/and Z is categorical rather than continuous. If so, how can we compare different groups when there are more than two levels? 

 

Thank you!

 

LauraCS
Staff

Hi@yws5055, Haley provided some guidance on using the add-in with binary X and/or Z here:

https://community.jmp.com/t5/JMPer-Cable/Who-what-why-and-how-Tools-for-modeling-and-visualizing/bc-... 

Unfortunately, the add-in doesn't work with categorical variables that have more than two levels.

 

Best,

~Laura

BaggingBird609
Level I

ModelFinal.PNG

Can a moderated mediation model with latent constructs be analysed with this method?

LauraCS
Staff

@BaggingBird609 ,

Great question! For a moderated mediation model with latent variables, I'd recommend using our Structural Equation Models (SEM) platform directly. There are a few ways to specify interactions with latent variables in SEM, and our platform will allow you to use the "Unconstrained Product Indicator" approach discussed by Marsh et al. (2012). In short, one has to create new product variables in the data table based on the indicators of the latent variables involved in the interaction. Then, the platform can be launched using those new product variables in addition to the indicators of all other latent variables. Lastly, one has to specify the latent variables, the latent variable interaction, and the mediation model (much like the diagram you included in your post).  After running the model, one obtains all the usual SEM output. However, the platform doesn't have (yet) the Johnson-Neyman plot and the interpretation of results, which is part of the add-in discussed in this post.

 

HTH,

~Laura

Shyamer
Level I

Hi, how does one extract the indirect effect for each of the two mediators in a parallel mediation model? The current output spits out only one indirect effect (which I presume is the sum of the two indirect effects in the model), but how can I get it to compute the magnitude and significance of each indirect effect, so that I can test which of the two mediators is significant or more influential? Thanks!

LauraCS
Staff

@Shyamer, that's an excellent question and we're working on making this easier for users. For now, I just uploaded an Add-In that will allow you to do what you need with a few clicks. You can find the file here: https://community.jmp.com/t5/JMP-Add-Ins/Estimating-specific-indirect-effects-in-structural-equation...

 

Please let me know if you have any questions! 

 

HTH,

~Laura