Mediation, and how wrong you can afford to be

Today let's understand mediation: what it means to split an effect into the part that runs straight through and the part that runs by a detour, and just as important, how to tell when that split can no longer be trusted.

Brightleaf, an online retailer, sends a win-back email to 200 customers and sends nothing to another 200. For each of the 400, Brightleaf records two things: whether that customer opened the Brightleaf app within a week, and how much they spent over the next month.

Here are eight of those 400 customers.

Look at customers E, F and H against customer G. All four got the email, but three of them opened the app and spent $72, while G did not open the app and spent only $54.

So some of the email's effect on spend looks like it runs through the app, not straight from the email itself.

That is the question this lesson answers. Did the email change spend on its own, or did it only change spend by getting people to open the app? And once you have split the answer into those two pieces, how wrong can that split afford to be before it stops meaning anything?

A total effect, split into two paths

Brightleaf's email can reach a customer's spend in two different ways.

The first is direct. The email itself, its subject line, its discount code, whatever is in it, can change what a customer spends, with nothing to do with the app at all.

The second runs through a detour. The email can get a customer to open the app, and opening the app can itself raise spend. The email's effect on spend, in that case, only exists because the email first changed something else, app-opening, which then changed spend.

Statisticians give that in-between variable a name. A mediator is a variable that the treatment changes, and which itself goes on to change the outcome. Here, opening the app is the mediator: the email changes whether a customer opens the app, and opening the app changes how much they spend.

That gives three quantities, and mediation analysis is mostly about keeping these three straight.

  • The total effect is email's full effect on spend, both paths combined, direct and through the app together.
  • The direct effect is the part of that total that skips the app entirely, the email acting straight on spend.
  • The indirect effect is the part that only exists because the email changed app-opening first, which then changed spend.

And the relationship between them is just addition: the total effect equals the direct effect plus the indirect effect. Nothing about that is an assumption yet, it is just how the two paths add up to the whole. The real assumptions come later in this lesson, once a number is attached to each of the three.