Moderation & Mediation in Regression Pui-Wa Lei, Ph.D Professor of Education Department of Educational Psychology, Counseling, and Special Education
Introduction Mediation and moderation are used to understand the mechanism(s) or process(es) by which an effect works and establish contingencies (Hayes, 2012). Mediation addresses how it determines whether/how a variable affects outcome through other variables or mediators. Moderation addresses when it determines whether the magnitude or direction of effect changes depending on other variables or moderators (i.e., interaction). They can be used in combination: e.g., moderated mediation, mediated moderation, conditional process modeling.
Relevant concepts Total effect Direct effect Indirect effect Conditional effect (i.e., simple slope) Conditional direct effect Conditional indirect effect
Simple Mediation Model Modeling steps: a M b 1. M = i M + ax + e M X X c c Y Y 2. Y = i Y + bm + c X + e Y Direct effect = c Indirect effect = ab Total effect = c + ab = c (in second model)
Does social behavior intervention have a long-term effect on Math achievement via immediate post intervention Math achievement? W1Math 20.2* 1.6* Cond Controls 83.1 Y5Math
Parallel Multiple Mediation Model Modeling steps: X M 1 a 1 b 1 c a 2 b 2 M 2 Y 1. M 1 = i M1 + a 1 X + e M1 2. M 2 = i M2 + a 2 X + e M2 3. Y = i Y + b 1 M 1 + b 2 M 2 + c X + e Y Direct effect = c Indirect effect via M 1 = a 1 b 1 Indirect effect via M 2 = a 2 b 2 Total indirect effect = a 1 b 1 + a 2 b 2 Total effect = c + a 1 b 1 + a 2 b 2 = c
Reid, et al. (2009). Gender, Language, and Social Influence: A Test of Expectation States, Role Congruity, and Self-Categorization Theories.65* Perceived similarity to speaker.49* Speaker assertive language style.31* Agreement with speaker regarding lowering drinking age.69* Perceived competence of speaker.35*
Warner & Vroman (2011). Happiness Inducing Behaviors in Everyday Life: An Empirical Assessment of The How of Happiness.45* Positive/Proactive behaviors.24* Extraversion.44* Happiness.33*.13* Spiritual behaviors.08.16* Physical health behaviors
Serial Multiple Mediation Model Modeling steps: M 1 a 3 M 2 1. M 1 = i M1 + a 1 X + e M1 2. M 2 = i M2 + a 2 X + a 3 M 1 + e M2 3. Y = i Y + b 1 M 1 + b 2 M 2 + c X + e Y a 1 a 2 b b 2 1 c X Y Direct effect = c Indirect effect via M 1 = a 1 b 1 Indirect effect via M 2 = a 2 b 2 Indirect effect via M 1 & M 2 = a 1 a 3 b 2 Total indirect effect = a 1 b 1 + a 2 b 2 +a 1 a 3 b 2 Total effect = c + a 1 b 1 + a 2 b 2 + a 1 a 3 b 2 = c
Van Jaarsveld, et al. (2010). The Role of Job Demands and Emotional Exhaustion in the Relationship Between Customer and Employee Incivility Job demands 1.66* Emotional exhaustion.16*.57* -.40.23* Perceived customer incivility.50* Employee incivility
Simple Moderation Model M X c 1 M c 2 Y X Y c 3 XM Y = i + c 1 X + c 2 M + c 3 XM + e = i + c 2 M + (c 1 + c 3 M)X + e Conditional effect of X = c 1 + c 3 M (i.e., simple slope for X)
Moderating the negative effect of Age on Endurance by Exercise Age -.26* Exercise Exercise.97* Endurance Age Endurance.05* Age X Exercise
Multiple Additive Moderators M W X M Y X Y W XM XW Y = i + c 1 X + c 2 M + c 3 W + c 4 XM + c 5 XW + e Conditional effect of X = c 1 + c 4 M + c 5 W
Multiple Multiplicative Moderators M M X XMW M Y X Y W XM XW MW Y = i + c 1 X + c 2 M + c 3 W + c 4 XM + c 5 XW + c 6 MW + c 7 XMW + e Conditional effect of X = c 1 + c 4 M + c 5 W + c 7 MW Conditional XM interaction = c 4 + c 7 W
Moderated Mediation (1 st stage) {or Mediated Moderation} W M a 1 a 2 M X a 3 b X 1. M = i M + a 1 X + a 2 W + a 3 XW + e M Y W XW c 3 c 2 c 1 Y 2. Y = i Y + bm + c 1 X + c 2 W + c 3 XW + e Y Conditional indirect effect of X via M = (a 1 + a 3 W)b Conditional direct effect of X = c 1 + c 3 W {In mediated moderation: Indirect effect of XW via M = a 3 b}
Does the indirect effect of social behavior intervention via immediate Math posttest on delayed Math posttest moderate by receipt of supplemental service? W1Math 22.0* SuppSer W1Math Cond -59.4* -8.0 1.6* 107.8 Cond Y5Math SuppSer Cond x SuppSer -19.1-111.0 Y5Math
Moderated Mediation (2 nd stage) W M M a b 1 X Y X c Y b 2 b 3 1. M = i M + ax + e M W MW 2. Y = i Y + b 1 M + b 2 W + b 3 MW + c X + e Y Conditional indirect effect of X via M = a(b 1 + b 3 W)
There are many more possibilities Hayes (2013-2015) documents 76 model templates (http://afhayes.com/public/templates.pdf)
Follow-up procedures What are the next steps after fitting the regression or path models? oprobing significant interactions otesting indirect effects
Probing Significant Interactions Purposes: testing conditional effects & understanding patterns of interactions. Methods (http://quantpsy.org/interact/index.htm): Pick a point approach: Select points of interest on the moderator(s) Calculate conditional effects based on the estimated regression functions Standard errors depend on variances and covariances among the regression coefficients Conditional effect estimate/appropriate SE ~ t (df=n-k-1) Johnson-Neyman approach: search for two points on the moderator that define the regions of significance, within which all conditional effects are statistically significant.
Testing indirect effects Indirect effects involve products of regression coefficients. Indirect effects are generally not normally distributed. Sobel s (1982) test is simple but relies on normal approximation (http://quantpsy.org/sobel/sobel.htm). Bootstrapping (standard errors and/or confidence intervals) with bias correction. Monte Carlo method (http://quantpsy.org/medmc/medmc.htm).
PROCESS (Hayes, 2013-2016): a SAS/SPSS macro PROCESS is a helpful tool in conducting these follow-ups (http://www.processmacro.org/download.html). It uses a regression-based path analytic framework (OLS or logistic) for estimating: direct and indirect effects in single and multiple mediator models, 2-3 way interactions in moderation models with simple slopes & regions of significance, conditional indirect effects in moderated mediation models (single/multiple mediators/moderators), indirect effects of interactions in mediated moderation models (single/multiple mediators).
Example: Age (centerx) x Exercise (centerz) on Endurance (yendu) SPSS Macro: Age Exercise Endurance 1. Open Macro syntax Run all; then close syntax. 2. Open data file. 3. New Syntax (type the following syntax and run all): Process VARS = yendu centerx centerz /Y = yendu /X = centerx /M = centerz /MODEL = 1 /COVCOEFF=1 /JN = 1 /PLOT = 1. 4. Copy/paste and run plot syntax (from output) to get interaction figure.
Model = 1 Y = yendu X = centerx M = centerz Sample size 245 ************************************************************************** Outcome: yendu Model Summary R R-sq MSE F df1 df2 p.4540.2061 94.0821 20.8585 3.0000 241.0000.0000 Model coeff se t p LLCI ULCI constant 25.8882.6466 40.0361.0000 24.6144 27.1619 centerz.9727.1365 7.1245.0000.7038 1.2417 centerx -.2617.0641-4.0852.0001 -.3879 -.1355 int_1.0472.0136 3.4757.0006.0205.0740 Product terms key: int_1 centerx X centerz R-square increase due to interaction(s): R2-chng F df1 df2 p int_1.0398 12.0804 1.0000 241.0000.0006
Conditional effect of X on Y at values of the moderator (M) centerz Effect se t p LLCI ULCI -10.6730 -.7660.1598-4.7931.0000-1.0807 -.4512-9.3730 -.7045.1438-4.8998.0000 -.9878 -.4213-8.0730 -.6431.1282-5.0161.0000 -.8957 -.3906-6.7730 -.5817.1132-5.1366.0000 -.8048 -.3586-5.4730 -.5203.0992-5.2459.0000 -.7156 -.3249-4.1730 -.4589.0864-5.3083.0000 -.6291 -.2886-2.8730 -.3974.0757-5.2491.0000 -.5466 -.2483-1.5730 -.3360.0680-4.9447.0000 -.4699 -.2022 -.2730 -.2746.0642-4.2742.0000 -.4012 -.1481 1.0270 -.2132.0653-3.2656.0013 -.3418 -.0846 2.3270 -.1518.0709-2.1420.0332 -.2914 -.0122 2.5333 -.1420.0721-1.9699.0500 -.2841.0000 3.6270 -.0904.0800-1.1291.2600 -.2480.0673 4.9270 -.0289.0917 -.3155.7526 -.2096.1517 6.2270.0325.1051.3091.7575 -.1745.2395 7.5270.0939.1196.7852.4331 -.1417.3295 8.8270.1553.1348 1.1519.2505 -.1103.4209 10.1270.2167.1506 1.4389.1515 -.0800.5134 11.4270.2782.1668 1.6677.0967 -.0504.6067 12.7270.3396.1832 1.8533.0651 -.0214.7005 13.6959.3853.1956 1.9699.0500.0000.7707 14.0270.4010.1999 2.0062.0460.0073.7947 15.3270.4624.2167 2.1339.0339.0356.8893
R Example 1. Get model estimates and covariance matrix from SPSS. Covariance matrix of regression parameter estimates constant centerz centerx int_1 constant.4181 -.0030.0002 -.0025 centerz -.0030.0186 -.0025.0002 centerx.0002 -.0025.0041.0000 int_1 -.0025.0002.0000.0002 2. Go to http://quantpsy.org/interact/mlr2.htm and type in appropriate values Calculate and Submit to Rweb.
Region of Significance ======================================================= Z at lower bound of region = 2.4937 Z at upper bound of region = 14.523 (simple slopes are significant *outside* this region.) Simple Intercepts and Slopes at Conditional Values of Z ======================================================= At Z = cv1... simple intercept = 21.2438(0.9332), t=22.7652, p=0 simple slope = -0.4871(0.0931), t=-5.2341, p=0 At Z = cv2... simple intercept = 25.8887(0.6466), t=40.0379, p=0 simple slope = -0.2617(0.064), t=-4.0867, p=0.0001 At Z = cv3... simple intercept = 30.5335(0.902), t=33.8497, p=0 simple slope = -0.0363(0.0931), t=-0.3899, p=0.697 ======================================================= Line for cv1: From {X=-29.18, Y=35.4565} to {X=32.82, Y=5.2581} Line for cv2: From {X=-29.18, Y=33.5244} to {X=32.82, Y=17.3005} Line for cv3: From {X=-29.18, Y=31.5924} to {X=32.82, Y=29.3426}
Simple Mediation Example W1Math Cond Y5Math Controls SPSS Macro: 1. Open Macro syntax Run all; then close syntax. 2. Open data file. 3. New Syntax (type the following syntax and run all): process vars = Y5grade Y5Math Cond Gender SpED SuppSer White W1Math /y = Y5Math /x = Cond /m = W1Math /model = 4 /total = 1 /effsize = 1 /boot=5000 /normal=1 /conf=95.
MODEL = 4 Y = Y5MATH X = COND M = W1MATH STATISTICAL CONTROLS: CONTROL= Y5GRADE GENDER SPED SUPPSER WHITE SAMPLE SIZE 466 Outcome: W1Math Model Summary R R-sq MSE F df1 df2 p.4968.2468 8538.7982 25.0687 6.0000 459.0000.0000 Model coeff se t p LLCI ULCI constant 264.2533 23.4152 11.2855.0000 218.2390 310.2677 Cond 20.1952 8.6145 2.3443.0195 3.2664 37.1240 Y5grade 41.7618 5.3418 7.8180.0000 31.2644 52.2591 Gender -4.4834 8.7270 -.5137.6077-21.6332 12.6665 SpED -34.5050 17.8227-1.9360.0535-69.5292.5191 SuppSer -62.8871 11.7330-5.3598.0000-85.9442-39.8299 White -4.6285 10.6344 -.4352.6636-25.5266 16.2697 ************************************************************************** Outcome: Y5Math Model Summary R R-sq MSE F df1 df2 p.2615.0684 521937.207 4.8025 7.0000 458.0000.0000 Model coeff se t p LLCI ULCI constant 724.8728 206.9122 3.5033.0005 318.2578 1131.4879 W1Math 1.5966.3649 4.3752.0000.8795 2.3138 Cond 83.0890 67.7527 1.2264.2207-50.0557 216.2337 Y5grade -7.9490 44.4571 -.1788.8582-95.3142 79.4162 Gender -42.3212 68.2497 -.6201.5355-176.4426 91.8001 SpED 8.0907 139.9103.0578.9539-266.8550 283.0364 SuppSer -67.7600 94.5592 -.7166.4740-253.5837 118.0636 White 76.4442 83.1598.9192.3585-86.9779 239.8663 ************************** TOTAL EFFECT MODEL **************************** Outcome: Y5Math Model Summary R R-sq MSE F df1 df2 p.1716.0294 542567.229 2.3208 6.0000 459.0000.0322 Model coeff se t p LLCI ULCI constant 1146.7857 186.6495 6.1441.0000 779.9922 1513.5792 Cond 115.3331 68.6688 1.6796.0937-19.6111 250.2774 Y5grade 58.7288 42.5807 1.3792.1685-24.9485 142.4062 Gender -49.4794 69.5654 -.7113.4773-186.1856 87.2268 SpED -47.0008 142.0696 -.3308.7409-326.1884 232.1868 SuppSer -168.1669 93.5274-1.7980.0728-351.9620 15.6281 White 69.0543 84.7699.8146.4157-97.5309 235.6394
*************** TOTAL, DIRECT, AND INDIRECT EFFECTS ************ Total effect of X on Y Effect SE t p LLCI ULCI 115.3331 68.6688 1.6796.0937-19.6111 250.2774 Direct effect of X on Y Effect SE t p LLCI ULCI 83.0890 67.7527 1.2264.2207-50.0557 216.2337 Indirect effect of X on Y Effect Boot SE BootLLCI BootULCI W1Math 32.2442 14.5252 5.8653 64.8212 Partially standardized indirect effect of X on Y Effect Boot SE BootLLCI BootULCI W1Math.0437.0570 -.0067.1707 Normal theory tests for indirect effect Effect se Z p 32.2442 15.9177 2.0257.0428
Example: Moderated mediation (1 st stage) SuppSer W1Math Cond Y5Math Process Vars = Y5grade Y5Math Cond Gender Sped Suppser White W1math /Y = Y5Math /X = Cond /M = W1math / W=suppser /Model = 8 /Boot=5000 /Conf=95 /Seed=34421.
Outcome: W1Math Model Summary R R-sq MSE F df1 df2 p.4971.2471 8554.6706 21.4688 7.0000 458.0000.0000 Model coeff se t p LLCI ULCI constant 263.3623 23.5509 11.1827.0000 217.0811 309.6434 Cond 21.9643 9.7694 2.2483.0250 2.7658 41.1628 SuppSer -59.3715 14.8734-3.9918.0001-88.6001-30.1429 int_1-7.9769 20.7090 -.3852.7003-48.6734 32.7196 Y5grade 41.7454 5.3469 7.8074.0000 31.2379 52.2529 Gender -4.3972 8.7380 -.5032.6150-21.5687 12.7743 SpED -34.0184 17.8839-1.9022.0578-69.1631 1.1263 White -4.6736 10.6449 -.4390.6608-25.5926 16.2453 Product terms key: int_1 Cond X SuppSer ************************************************************************** Outcome: Y5Math Model Summary R R-sq MSE F df1 df2 p.2633.0693 522541.216 4.2562 8.0000 457.0000.0001 Model coeff se t p LLCI ULCI constant 713.6595 207.6762 3.4364.0006 305.5407 1121.7783 W1Math 1.5921.3652 4.3596.0000.8744 2.3098 Cond 107.8083 76.7736 1.4042.1609-43.0649 258.6814 SuppSer -19.1027 118.2486 -.1615.8717-251.4811 213.2756 int_2-111.0484 161.8784 -.6860.4931-429.1668 207.0700 Y5grade -7.9890 44.4829 -.1796.8575-95.4053 79.4273 Gender -41.1415 68.3108 -.6023.5473-175.3838 93.1007 SpED 14.7099 140.3234.1048.9166-261.0492 290.4690 White 75.7949 83.2133.9109.3629-87.7332 239.3231 Product terms key: int_2 Cond X SuppSer
******************** DIRECT AND INDIRECT EFFECTS ************************* Conditional direct effect(s) of X on Y at values of the moderator(s): SuppSer Effect SE t p LLCI ULCI.0000 107.8083 76.7736 1.4042.1609-43.0649 258.6814 1.0000-3.2402 142.9425 -.0227.9819-284.1462 277.6659 Conditional indirect effect(s) of X on Y at values of the moderator(s): Mediator SuppSer Effect Boot SE BootLLCI BootULCI W1Math.0000 34.9697 15.8583 6.3788 68.5921 W1Math 1.0000 22.2696 34.1615-42.9357 91.0283 ******************** INDEX OF MODERATED MEDIATION ************************ Mediator Index SE(Boot) BootLLCI BootULCI W1Math -12.7001 37.3459-87.9949 58.1219 When the moderator is dichotomous, this is a test of equality of the conditional indirect effects in the two groups.
References Baron, R. M., & Kenny, D. A. (1986). The moderator mediator variable distinction in social psychological research: Conceptual, strategic, and statistical considerations. Journal of personality and social psychology, 51(6), 1173. Bauer, D. J., & Curran, P. J. (2005). Probing interactions in fixed and multilevel regression: inferential and graphical techniques. Multivariate Behavioral Research, 40, 373-400. Edwards, J. R., & Lambert, L. S. (2007). Methods for integrating moderation and mediation: A general analytical framework using moderated path analysis. Psychological Methods, 12, 1-22. Hayes, A. F. (2012). PROCESS: A versatile computational tool for observed variable mediation, moderation, and conditional process modeling [White paper]. Retrieved from http://www.afhayes.com/public/process2012.pdf Hayes, A. F. (2013). Introduction to Mediation, Moderation, and Conditional Process Analysis: A Regression-Based Approach. Guilford. Hayes (2013-2015). Model templates for PROCESS for SPSS and SAS. Retrieved from http://afhayes.com/public/templates.pdf. Hayes (2013-2016). PROCESS: A SAS/SPSS macro. Available from http://www.processmacro.org/download.html. Reid, S. A., Palomares, N. A., Anderson, G. L., & Bondad-Brown, B. (2009). Gender, Language, and Social Influence: A Test of Expectation States, Role Congruity, and Self-categorization Theories. Human Communication Research, 35, 465-490. Van Jaarsveld, D. D., Walker, D. D., & Skarlicki, D. P. (2010). The Role of Job Demands and Emotional Exhaustion in the Relationship between Customer and Employee Incivility. Journal of Management, 36, 1486-1504. Warner, R. M. & Vroman, K. G. (2011). Happiness Inducing Behaviors in Everyday Life: An Empirical Assessment of The How of Happiness. Journal of Happiness Studies, 12, 1063-1082.