

Specifically, students with high self-efficacy experience less anxiety on important tests than students with low self-efficacy while all students feel relatively low anxiety for less important tests. For example, academic self-efficacy (confidence in own’s ability to do well in school) moderates the relationship between task importance and the amount of test anxiety a student feels (Nie, Lau, & Liau, 2011). Moderators can stength, weaken, or reverse the nature of a relationship. Rather than testing a causal link between these other variables, moderation tests for when or under what conditions an effect occurs. Moderation analysis also allows you to test for the influence of a third variable, Z, on the relationship between variables X and Y. However, the mediation package method is highly recommended as a more flexible and statistically powerful approach. It is covered in this chapter because it provides a very clear approach to establishing relationships between variables and is still occassionally requested by reviewers. The Baron & Kelly method is among the original methods for testing for mediation but tends to have low statistical power. In R, this kind of analysis may be conducted in two ways: Baron & Kenny’s (1986) 4-step indirect effect method and the more recent mediation package (Tingley, Yamamoto, Hirose, Keele, & Imai, 2014).

For instance, people with higher incomes tend to live longer but this effect is explained by the mediating influence of having access to better health care. This is also sometimes called an indirect effect. Mediators describe the how or why of a (typically well-established) relationship between two other variables and are sometimes called intermediary variables since they often describe the process through which an effect occurs. Mediation analysis tests a hypothetical causal chain where one variable X affects a second variable M and, in turn, that variable affects a third variable Y.
