Moderated mediation
In statistics, moderation and mediation can occur together in the same model. Moderated mediation, also known as conditional indirect effects, occurs when the treatment effect of an independent variable A on an outcome variable C via a mediator variable B differs depending on levels of a moderator variable D. Specifically, either the effect of A on B, and/or the effect of B on C depends on the level of D. Langfred (2004) model. Langfred (2004) was the first to provide a comprehensive treatment of the question of how to conceptualize moderated mediation, classify different types of moderated mediation  models, and to develop the logic and methodology for the statistical analysis of such models using multiple regression. Because there was no established procedure to analyze models with moderated mediation, Langfred (2004) first describes the different types of moderated mediation models that might exist, noting that there are two primary forms of moderated mediation. Type 1, in which the moderator operates on the relationship between the independent variable and the mediator, and Type 2, in which the moderator operates on the relationship between the mediator and the dependent variable. Langfred reviews the existing perspectives on moderated mediation (James and Brett , 1984), and notes that an accepted statistical approach already exists for Type 1 moderated mediation, as demonstrated by Korsgaard, Brodt, and Whitener (2002). Type 2 moderation, however, is more statistically difficult, so Langfred reviews three different possible approaches for the analysis, and ultimately recommends one of them as the correct technique. Langfred (2004) is often overlooked because the academic paper itself is not about statistical methodology. Rather, because the model in the paper involved moderated mediation, a very large appendix was included, in which the definitions and procedures for the regression analysis was developed. Muller, Judd, & Yzerbyt (2005). Muller, Judd , and Yzerbyt (2005) provided additional clarity and definition of moderated mediation. The following regression equations are fundamental to their model of moderated mediation, where "A" = independent variable, "C" = outcome variable, "B" = mediator variable, and "D" = moderator variable. This equation assesses moderation of the overall treatment effect of A on C. This equation assesses moderation of the treatment effect of A on the mediator B. This equation assesses moderation of the effect of the mediator B on C, as well as moderation of the residual treatment effect of A on C. This fundamental equality exists among these  equations: In order to have moderated mediation, there must be an overall treatment effect of A on the outcome variable C ("β"), which does not depend on the moderator ("β" = 0). In addition, the treatment effect of A on the mediator B depends on the moderator ("β" ≠ 0) and/or the effect of the mediator B on the outcome variable C depends on the moderator ("β" ≠ 0). At least one of the products on the right side of the above equation must not equal 0 (i.e. either "β" ≠ 0 and "β" ≠ 0, or "β" ≠ 0  and "β" ≠ 0). As well, since there is no overall moderation of the treatment effect of A on the outcome variable C ("β" = 0), this means that "β" cannot equal 0. In other words, the residual direct effect of A on the outcome variable C, controlling for the mediator, is moderated. Additions by Preacher, Rucker, and Hayes (2007). In addition to the three manners proposed by Muller and colleagues in which moderated mediation can occur, Preacher, Rucker, and Hayes (2007) proposed that the independent variable A itself can moderate the effect of the mediator B on the  outcome variable C. They also proposed that a moderator variable D could moderate the effect of A on B, while a different moderator E moderates the effect of B on C. Differences between moderated mediation and mediated moderation. Moderated mediation relies on the same underlying models (specified above) as mediated moderation. The main difference between the two processes is whether there is overall moderation of the treatment effect of A on the outcome variable C. If there is, then there is mediated moderation. If there is no overall moderation of A on C, then there is moderated mediation. Testing for  moderated mediation. In order to test for moderated mediation, some recommend examining a series of models, sometimes called a piecemeal approach, and looking at the overall pattern of results. This approach is similar to the Baron and Kenny method for testing mediation by analyzing a series of three regressions. These researchers claim that a single overall test would be insufficient to analyze the complex processes at play in moderated mediation, and would not allow one to differentiate between moderated mediation and mediated moderation. Bootstrapping has also been suggested as a method of estimating the sampling distributions of a moderated mediation  model in order to generate confidence intervals. This method has the advantage of not requiring that any assumptions be made about the shape of the sampling distribution. Preacher, Rucker and Hayes also discuss an extension of simple slopes analysis for moderated mediation. Under this approach, one must choose a limited number of key conditional values of the moderator that will be examined. As well, one can use the Johnson–Neyman technique to determine the range of significant conditional indirect effects. Preacher, Rucker, and Hayes (2007) have created an SPSS macro that provides bootstrapping estimations as well as Johnson–Neyman results . Their macro is made obsolete with the release of PROCESS for SPSS and SAS, described in "Introduction to Mediation, Moderation, and Conditional Process Analysis" (Hayes, 2013)