So now let's look at moderation. And we'll look at first the model and then the graphical example of moderation. So moderation is a different statistical test. And what it says is, or what it tests is, that the relationship between variables X and Y is predicted by the value or level of M. So, the model is different here. I'm modeling y, and regressing y on X, M and the X*M interaction. Usually those are centered before hand as well. So in a linear modeling framework you can see this here. So I've got y is Beta naught + Beta1 timex x + Beta2 times m + d, which I'm calling the moderation effect there, times the (x*m) interaction. And that d tests the moderation effect. So mediation and moderation are distinct statistical tests. But in some cases we might expect both. So for example, if X really drives increases in M and Y and when X is off, like the hose in a water pipe is off, there's no flow, then there's really not much happening in either M or Y. And in such a case, we would expect both mediation and moderation to be significant. So here's a graphical example of moderation now. And this is a great example, in keeping with our theme. So now what we're looking at in this study is whether the correlation in opioid binding values between the inter singular and the PAG in the mid brain, both opioid rich areas, is stronger when you're on a placebo versus no placebo or just a control condition. And this is what we'd expect if there's a widespread increase across the brain in opioids with a placebo that causes those areas to become more correlated with one another. And this is, in fact what we see in this case. So you can see under the placebo condition, there's a positive correlation, and under the control condition, there's about zero correlation. And what moderation is testing then, is the significance of the difference between those two slopes, under those two conditions. So this is also a directional model, but again, it's better not to make a strong directional interpretation. So I've drawn this, in the way that's saying that the PAG is the outcome and the placebo influences the relationship between singular and PAG, but I could have other interpretations as well of this interaction. So I could say M influences the X on Y, or X influences the M to Y relationship, or other scenarios as well. Like for example, M moderates the Y to X relationship. So the model itself isn't adequate to distinguish between these alternatives. And so you have to make your own interpretation. And this is a caution because sometimes people would do these moderation tests, and then they'll just come up with whatever interpretation that they prefer, and then write as though that's the only interpretation. So we just have to keep that in mind. Now we'll talk about multilevel mediation. And multilevel mediation is possible, when we have multiple observations of X, M, and Y for each person in the sample. So typically one observation is a person. But now one observation here could be a trial collected within a person. You may have 60 trials for each person. And now we have this case, where we have replicated these variables for Person 1, 2, 3, and so on up to person n. Now we have a path coefficient for each person, for each path. And these path strengths vary across subjects potentially. And that's what we're testing when we test the significance of the path coefficients in a multilevel setting. So here the subject level pathway strengths, a, b, c, c prime, are all treated as random variables. And this is a mixed-effect model then with a random intercept and random slope, and subject treated as random effect. So in this case, the test of what influences c versus c prime, that comparison that's the mediation, is both the a*b product and the covariance between a and b. If the subject's who have a also have high b, then we're going to be more likely to see a significant multilevel mediation effect. And that makes sense. A second level moderator then uses person level variables, like let's say somebody's age, anything that has one observation per person, to predict the path coefficient. So those within subject relationships. So in this model here, I've got the path coefficients for a, that's a vector of a's, being modeled as an intercept, that would be the average path coefficient a, if age is mean centered, plus Beta1 times age, plus error. So now this Beta1 here tests age as a moderator of Path a. And that's quite useful. So I can specify both within person variables and between person variables. And moderated mediation refers to an effect where a person-level variable moderates this a* b effect within person. So there's stronger mediation for some subjects than others. Now let's look at an example of moderated mediation in the brain. In this experiment we have a speech stressor that's off on off within person. We're looking at activity in the anterior cingulate across time, as the speech preparation stressor is coming on and off, and then we're also measuring heart rate, moment by moment across time, for each person. So path a is a test of whether the speech stressor task affects the brain. And what we can see here is both within person and between person effects, so within person on the left, we see the relationship between the predictor, which is on versus off stress on the X axis, and brain response on the Y axis. And each of those blue lines is one individual person slope. And the black line with error bars is the group mean. So you can see there's a positive relationship, increase in activity, when the stress is on. On the right, what we see is the individual differences in moderation. And the moderator here is the average heart rate increase, whether you're a heart rate reactor. And what you can see here is that that speech to brain relationship is stronger for those who end up being heart rate reactors. So the path a slope is moderated by heart rate reactivity. Now we'll look at the path b effect, and here we're looking at the relationship between pregenual cingulate activity and heart rate controlling for the stressor, so on average across stress on and off. And what you see here on the left is the relationship for each person, and on average between the brain response activity at a given time and the heart rate at that time. So there is a positive relationship there. And on the right, the moderation effect again. So the heart rate reactors, those who respond more strongly, also have a stronger brain-heart relationship. And we can test the mediation, a times b, and that's also significant here. And so in this case, what we have is moderated mediation. That the mediation effects, a times b, are strongest for the reactors who show the heart rate increases, due to the task. So path analysis is an integrative framework that can capture all of these effects really in one systematic model. And if we didn't do this we'd have to do a series of analyses to approximate these things. So for example, to look at within person effects, we would do a standard GLM response to the task, that's number one. And to look at the brain heart relationships, we could do a parametric modulator with heart rate in some way, couldn't quite do it in standard software, but we could sort of approximate that effect. Except, one issue is that the predictor and the outcome are reversed. Right here we have brain predicting heart and in the standard analysis you have heart predicting brain. And additionally what we need to do is control for the stress task when we assess that model. So, it's possible but a little bit tricky to do that. Now if we look at the between person effects, this would be a brain behavior correlation between the contrast value, stress on off, and the heart rate. So, that's the third analysis. And to look at the path b, that's a fourth analysis. That would be whether our parametric modulator effect is correlated with heart rate across people. And then if I have all of these four tests, I might want to do a conjunction analysis to test whether all of the effects are significant together. So that would be sort of a standard way of approximating this, but the mediation framework gives you, really, an elegant way to do all of these tests in one integrated modeling framework. And now, this brings us to this concept of mediation effect parametric mapping. And very simply, I might not know where to expect the effects in the brain exactly, I might want to search across brain voxels for where there are significant mediation effects. And that's exactly what this technique and the tool box that's available, you can see it at the bottom, does. So, what we can do is make maps of the a, the b, and the a*b effect with bootstrap testing at each voxel for a significance. And look at all those maps. We can do single level and multi-level analysis. We can also include, then, person level moderators of those within subject path coefficients, if we want to. You see some of the papers here. So this has been really a productive thing for our lab to do, and they decided to share it with many other labs as well. People are publishing a number of papers using this technique. We can also think about going from a single mediator case to models where there's multiple brain mediators at once. We don't really think that each brain region is operating independently. So once you found some interesting brain regions, we can put them into the same mediation model jointly, and ask whether each one mediates or explains a significant amount of the outcome variance, when we control for the other mediators as well. So this is a promising direction to sort of go from single brain regions to models in which multiple brain regions can work together or even interact to mediate effects on an outcome. So here's some core ideas on mediation and moderation. The mediation framework provides a natural way of linking experimental variables, brain, and behavior in a single model. It's got several advantages in interpretability. Because it's based on the linear models that we all know and sometimes love, it's flexible. We can specify any set of variables as the inputs or outputs, it could be experiment, it could be brain to brain variables, it could be brain to physiology or brain to behavior. It's transparent in the sense of, we can sort of get a sense of how it's working, we can examine the assumptions and the limitations, which are really very similar to all the other assumptions and limitations of linear models in general. And we can use this to build models of brain mechanisms with multiple brain regions simultaneously predicting outcomes. And finally we can integrate level of analysis. We can capitalize on the rich within subject data that we observe with fMRI but also the person level data that might influence how strong those relationships within personal are. And finally, these tools are complementary to other kinds of tools, like ICA or machine learning, or pattern recognition tools, that we'll talk about in other parts of the course. That's the end of this module. Stay tuned for more multivariate analysis. [SOUND]