Problem
A product team wanted to know how the time users spend in one site section affects four-week retention (RR4W). An A/B test was ruled out: the section is long established, switching it off for new users would be slow, expensive and risky, and an on/off test would not show what one extra second is worth. Propensity score matching needs a binary treatment, so cutting time at a threshold would discard the dose information.
Example from the article: over two months the average time in the section grew from 90 to 120 seconds, and the team wanted to know how much retention that growth explains.
Solution in brief
Generalized Propensity Score (GPS) extends propensity scoring to a continuous treatment. Two models predict each user's typical time and its spread from covariates, and GPS is the normal density of the observed time under them. A quadratic outcome model on time and GPS gives a dose-response curve, checked with a bootstrap interval, covariate balance and a placebo run.
Questions this case answers
- How to estimate the effect of a continuous exposure on a delayed outcome from observational data when the exposure cannot be randomized or switched off
- How to avoid losing information when the treatment is a dose rather than a yes/no flag in observational causal analysis
- How to estimate the effect of time spent in a site section on retention when an A/B test is not possible
- How to estimate a dose-response curve for a continuous treatment from historical data
Tools and methods
- Generalized Propensity Score (Hirano and Imbens, 2004) — balances users by how typical their time is for them
- Random forest and gradient boosting — predict expected time and its variance
- statsmodels OLS with HC3 errors — outcome model
- Bootstrap — 95% confidence interval around the dose-response curve
- Standardized mean difference — covariate balance check
- Placebo run — random treatment should give no effect
Google or a one-time email code. No password.
