Confounding
A hidden factor that affects both the cause and the effect.
Users who use a feature may retain better because they were already engaged, not because of the feature. Confounders make correlations look causal. Randomized experiments are the most reliable way around them.
Why it matters for a product engineer
In product data, the users who do something are rarely like the users who do not. They are more engaged, more experienced, or on a bigger plan, and those differences also drive the outcome. If you mistake this for an effect, you build features that do nothing, and then promote them as successes.
How to do it
- For any claim like “users who do X do better”, ask what makes people do X in the first place.
- Draw the causes: the possible confounder, the feature and the outcome, with arrows between them.
- Compare like with like, such as users with similar activity before they used X.
- Adjust for confounders in the analysis. You can only adjust for what you measured.
- When the decision is important, run a randomized experiment instead.
Common mistakes
- Adjusting for a few variables and calling the result causal.
- Adjusting for something that the feature itself changed.
- Ignoring the direction: engagement can cause feature use, not only the other way.
- Trusting a strong association because the sample is large.
Example
Many observational studies found less heart disease in women who used hormone replacement therapy. A meta-analysis gave a relative risk of 0.56. Then the large, randomized Women’s Health Initiative trial found a higher risk for women assigned to the therapy. One likely explanation is confounding. A 2004 study found that women in worse social and economic circumstances, from childhood on, were less likely to use the therapy, and those circumstances also affect heart disease.
Heart disease with hormone therapy, relative to no therapy
- Observational studies0.56
- Randomized trial1.29
Below 1 means less heart disease. When women chose the therapy, it looked protective. When chance chose, the risk was higher.
ReportedLawlor, Davey Smith and Ebrahim, American Journal of Public Health, 2004
Sources: Socioeconomic position and hormone replacement therapy use: explaining the discrepancy in evidence from observational and randomized controlled trials (Lawlor, Davey Smith and Ebrahim) ↗ · Women's Health Initiative (NHLBI) ↗ · How and when to control for confounders during product usage analyses (Heap) ↗
Resources
2- articleGo deeper
How and when to control for confounders during product usage analyses ↗
Heap · 2021 · 10 minUses the familiar "users of this feature retain better" case to show how a confounder fakes an effect and how to adjust for it.
- bookGo deeper
Causal inference for the brave and true ↗
Matheus Facure · free online bookA free, rigorous and readable book on causal inference with Python code, from randomized tests to methods for when you cannot run one.
Tools
1- ToolFree
Evan's Awesome A/B Tools
Free calculators for sample size, significance of results and sequential tests.