At a Glance
A confounder causes both the program and the outcome, a mediator is a step the program works through, and a collider is caused by both. They look alike in a data table and behave in opposite ways once you adjust for them, which is why evaluators need to tell them apart before choosing what to control for.
At a Glance
| Confounder | Mediator | Collider | |
|---|---|---|---|
| Where it sits | Before the program | Between program and outcome | After both program and outcome (or their causes) |
| Arrows | Variable points to program and to outcome | Program points to variable, variable points to outcome | Program and outcome (or their causes) both point to variable |
| What it does | Creates a false effect or hides a real one | Carries part or all of the real effect | Creates a false link when you filter or adjust on it |
| Adjust for it? | Yes, if you can measure it | No, if you want the total effect. Yes, if you want to study the mechanism | No. Do not filter or control on it |
| If you get it wrong | Biased effect estimate | Effect looks smaller than it is | A new bias appears that was not there |
| Small example | Household wealth | Water treated at home | Visiting the clinic |
The confounding variables entry explains why confounding matters. This page shows the neighbors a confounder is often mistaken for.
Causal Diagram Example
A Causal Diagram Example: Safe Water Clubs
Take a fictional program, Safe Water Clubs, where villages join a club that teaches and supplies household water treatment. The outcome is the number of diarrhea days per child in the past two weeks. A causal diagram lists the arrows you believe exist. Read each row as "A causes B."
| Arrow | From | To | Role of the variable |
|---|---|---|---|
| 1 | Household wealth | Joining a club | Wealth is a confounder |
| 2 | Household wealth | Diarrhea days | (same confounder, second arrow) |
| 3 | Joining a club | Water treated at home | Treated water is a mediator |
| 4 | Water treated at home | Diarrhea days | (same mediator, second arrow) |
| 5 | Joining a club | Visiting the clinic | Clinic visit is a collider |
| 6 | Diarrhea days | Visiting the clinic | (same collider, second arrow) |
Walk through the three roles in this map:
- Wealth is a confounder. Better-off households are more likely to join and also have less diarrhea for other reasons, such as piped water and better toilets. If you compare members and non-members without allowing for wealth, the program looks more effective than it is.
- Treated water is a mediator. The club works mainly because families treat their drinking water. If you adjust for it, you remove the very pathway you want to measure, and the program looks like it does little.
- A clinic visit is a collider. Clubs refer sick children to the clinic, and sick children go to the clinic anyway. Both arrows end at the visit.
For a total-effect question ("Do Safe Water Clubs reduce diarrhea?"), adjust for wealth, leave treated water alone, and do not restrict to clinic records. For a mechanism question ("How much of the effect goes through treated water?"), study the mediator on purpose, with a method built for it, and say so in the report.
The Collider Trap
How a Collider Creates a False Effect
Colliders are the least familiar of the three, and the easiest to fall into when the only data you have is clinic or facility records. Suppose that in a fictional district the program has no effect on illness at all: 40 percent of children are ill in both groups. Clinic visits depend on both membership and illness.
| Members (500 children) | Non-members (500 children) | |
|---|---|---|
| Ill children (40%) | 200 | 200 |
| Share of ill children who visit the clinic | 90% | 60% |
| Ill children seen at the clinic | 180 | 120 |
| Well children (60%) | 300 | 300 |
| Share of well children who visit the clinic | 50% | 10% |
| Well children seen at the clinic | 150 | 30 |
| Total seen at the clinic | 330 | 150 |
| Share of those seen who are ill | 55% | 80% |
Among clinic records alone, members look much healthier (55 percent ill against 80 percent) even though the true rate is 40 percent in both groups. The gap is created by the filter. Club referrals bring more of the members' well children to the clinic, so the clinic sample holds a larger share of well members. The numbers are made up to show the mechanism. Real data will not be this tidy, but the direction of the bias will be the same.
The same trap appears when a statistical model includes the collider as a control variable, not only when you filter the sample.
What to Do
Three Questions to Classify Any Variable
Ask these in order about any variable you are thinking of controlling for.
- Does it happen before the program, and does it influence both who takes part and the outcome? If yes, it is a confounder. Measure it and adjust for it where you can. If you cannot measure it, name it as a limit.
- Does the program change it, and does it in turn change the outcome? If yes, it is a mediator. Leave it out of a total-effect analysis. Include it only to answer a how-does-it-work question.
- Do the program and the outcome (or things that cause them) both change it? If yes, it is a collider. Do not filter on it or control for it.
A single variable can play more than one role depending on the question and the timing, so draw the map for the specific question you are asking. A variable measured after the program ends is much more likely to be a mediator or a collider than a confounder. When timing is unclear, ask the program team what happened first.
Common Mistakes
Adjusting for everything available. More controls do not mean less bias. Adding a mediator hides part of the effect, and adding a collider can create bias from nothing.
Treating "correlated with both" as the definition of a confounder. A mediator is also related to both program and outcome. The test is where it sits on the arrow map, not only the correlations.
Using only service records. Data from people who reached a clinic, school or service point is filtered by a collider by construction. Say what the sample leaves out, and compare with a population-based source where you can.
Drawing the diagram after the analysis. The diagram should come first, from the theory of change and field knowledge, so the choice of controls is not driven by which result looks best.
Claiming a design has solved it. Randomization balances confounders on average at the start. It does not protect you from adjusting for a mediator or filtering on a collider afterward. For design choices, see RCT vs quasi-experimental design and the counterfactual entry, and for the wider question of cause see causal inference.