Causal reasoning
Telling correlation from causation in product data.
Causal reasoning asks what else could explain a pattern. When experiments are not possible, methods like difference-in-differences or natural experiments help. Most bad product decisions from data come from treating correlation as cause.
Why it matters for a product engineer
Product data is full of patterns that look like causes. Usage went up after a launch; churn fell after a price change. Causal reasoning asks what else could explain the pattern, and what would have happened without the change. A product engineer who asks this avoids giving credit, or blame, to the wrong work.
How to do it
- Write the claim as cause and effect, then list the other explanations: seasons, campaigns, changes in the user mix, bugs, and cause and effect the other way round.
- If you can, run a randomized experiment.
- If you cannot, find a comparison group that did not get the change but followed a similar trend before it.
- Use difference-in-differences: compare the change in the group that got the change with the change in the comparison group, over the same period.
- Check the trends before the change. If they already differed, the method does not hold.
- Look for natural experiments, such as rollouts by country, outages and policy changes.
Common mistakes
- Before-and-after comparisons with no comparison group.
- A comparison group that was already on a different trend.
- Reading a correlation in a dashboard as a cause.
- Ignoring that the effect may cause the supposed cause.
Example
Researchers wanted to know whether ChatGPT reduced activity on Stack Overflow. They could not run an experiment. So they compared Stack Overflow with its Russian and Chinese counterparts, where access to ChatGPT is limited, and with mathematics forums, where ChatGPT was less capable. A difference-in-differences model estimated 16% fewer weekly posts on Stack Overflow. The effect grew over time, and it was larger for the most widely used programming languages.
The effect of ChatGPT on Stack Overflow, from a comparison
- 16%
- Fewer weekly posts
- Difference-in-differences estimate
- Similar
- Votes on new posts
- So not only weak posts were lost
The comparison sites show roughly what Stack Overflow would have looked like without ChatGPT. The gap between the two is the estimate.
Reporteddel Rio-Chanona, Laurentsyeva and Wachs, arXiv, 2023
Sources: Are large language models a threat to digital public goods? Evidence from activity on Stack Overflow (del Rio-Chanona, Laurentsyeva and Wachs) ↗ · Difference-in-differences (Matheus Facure, Causal inference for the brave and true) ↗
Resources
3- 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
Difference-in-differences ↗
Matheus Facure · 25 minThe method to reach for when a change shipped to one group or market and you cannot run an A/B test.
- 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.