Problem
A retail analyst has to measure what an event did to one unit, such as a store, when nobody split treatment and control beforehand. A plain before-and-after comparison does not say what the unit would have done without the event, so the size of the effect stays uncertain.
Example from the article: a competitor opened next to Store #10 in March 2014. Its weekly sales fell from 68,199.28 to 51,283.35 on average (about 25%), while nine stores without a competitor kept a steady pattern. The data is synthetic, based on the Rossmann Stores dataset from Kaggle.
Solution in brief
Fit a linear regression on the pre-event period that predicts the treated store's sales from the sales of control stores. Apply it to the post-event period to get a synthetic "no competitor" series, and read the gap between actual and synthetic as the effect. A before-and-after test then cross-checks it.
Questions this case answers
- How to estimate the effect of an external event on one unit's metric when no randomized control group exists and only similar untouched units are available
- How to measure what a competitor's opening did to one store's sales when no control group was planned?
- How to build a counterfactual sales series for a single treated unit from similar untreated units?
- How to confirm a before-and-after drop is caused by an external event and not by a general trend?
Tools and methods
- Synthetic control — builds the counterfactual series for the treated store from untouched stores
- Linear regression (scikit-learn) — learns the weights of control stores on pre-event data
- Before and after test with confidence interval — checks the drop for the treated store and no change for controls
- CausalImpact (Python package causalimpact) — a ready-made implementation of the same idea, used as a cross-check
Google or a one-time email code. No password.