← Research/Frisch-Waugh-Lovell Theorem and Orthogonalizationlive · interactive
IncrementalityCausal InferenceOLSPython
Research · April 2025

Frisch-Waugh-Lovell Theorem and Orthogonalization

Marketing campaigns run during high-demand periods — so naive regression always overestimates their effect. The FWL theorem shows how partialling out demand from both spend and revenue isolates the true campaign lift.

The Setup

You want to measure the true revenue lift from a paid media campaign (X). But there's a confounder: organic demand (W). Marketing teams activate campaigns when demand is already high — peak seasons, product launches, high search-intent periods. That same demand drives revenue on its own, independent of the campaign.

The true causal effect of the campaign is $8,000in weekly revenue. Naive OLS will overestimate this because it can't separate the revenue driven by demand from the revenue driven by the campaign.

W — Confounder
Organic Demand
search interest index (20–80)
X — Treatment
Campaign Active
0 = off, 1 = on
True causal effect
$8,000
weekly revenue lift from campaign
Interactive
Naive OLS vs Truth — adjust confounding strength
Move the slider to increase how strongly organic demand drives both campaign activation and revenue
live
Confounding strength0.0×
No confoundingStrong confounding
True effect
$8,000
Naive OLS
$9,160
+14.5% bias
FWL estimate
$9,242
+15.5% bias
X vs Y — naive regression
X̃ vs Ỹ — after orthogonalization (FWL)

Notice how at high confounding, the naive slope dramatically overestimates the campaign's revenue lift — but the FWL estimate stays close to $8,000 regardless of how strongly demand drives campaign activation. This is the theorem in action.

The Theorem — Step by Step

The Frisch-Waugh-Lovell theorem says the coefficient β on X in the full regression Y ~ X + W is identical to β in the partialled-out regression Ỹ ~ X̃.

Interactive
Full regression: Y ~ X + W
OLS with all variables — X coefficient is the causal effect
live
# Full regression coefficient on X
β_X = 9,160# naive — confounded by demand

Why This Matters for Marketing

Every marketing channel suffers from this problem. Paid search runs heavier during Q4 — when people already buy more. Retargeting targets users who were already close to converting. Brand campaigns scale up alongside organic growth. In every case, naive regression attributes demand-driven revenue to the campaign and overestimates its true incremental effect.

FWL is also the theoretical backbone of Double Machine Learning (DML) — the modern approach to incrementality measurement. In DML, you replace the linear regression in steps 1 and 2 with any ML model (gradient boosting, random forest), allowing you to control for non-linear, high-dimensional confounders like day-of-week, audience segments, and seasonality curves. The FWL logic still holds in the residual space.

Naive OLS at max confounding
$30,099
severely biased — attributes demand to campaign
FWL at max confounding
≈ $8,000
recovers true incremental lift
Reference

Facure, Matheus. Causal Inference in Python: Applying Causal Inference in the Tech Industry. O'Reilly Media, 2023. Chapter on regression and the FWL theorem.