Causal inference without randomization and A/B/C test analysis
Statistics & ExperimentsModel answerLast updated
Estimate treatment effects using observational methods when experiments are infeasible, then analyze a three-arm conversion test with proper uncertainty and multiple-comparison handling.
Part A — Estimating treatment effects without randomization
You work as a senior data scientist on a product initiative—a new feature, policy adjustment, or model deployment. Leadership needs to understand the causal effect of this change on key metrics, but running a controlled experiment is not an option due to regulatory requirements, technical constraints, or the need for immediate full rollout.
Your task:
-
Design a complete approach to estimate the causal impact using non-experimental data. You may incorporate machine learning for counterfactual prediction if suitable.
-
Your proposal must include:
- The estimand: precisely define what you are measuring (e.g., average treatment effect on the treated, incremental metric lift per user per day).
- Assumptions necessary for causal identification from observational data.
- Threats to validity: confounding sources, selection mechanisms, interference patterns, data quality issues, temporal effects, and other failure modes.
- Validation strategy: how you will test the robustness of your estimates using placebo tests, sensitivity checks, held-out validation, or other diagnostic techniques.
-
Discuss how you distinguish transient effects from sustained impact, and what additional information or modeling would help separate short-run dynamics from long-run outcomes.
Part B — Three-arm experiment and post-launch forecasting
You conducted an online test comparing three treatments (call them A, B, and C). The success metric is conversion rate, calculated as:
conversion_rate = purchases / visits
Each visit is independent, and at most one purchase occurs per visit.
Observed data:
- Treatment A: 150 visits, 43 purchases
- Treatment B: 200 visits, 48 purchases
- Treatment C: 100 visits, 15 purchases
Questions:
-
Which treatment performs best?
- Calculate point estimates of conversion rate for each arm.
- Quantify uncertainty using appropriate confidence or credible intervals.
- Handle multiple comparisons correctly when deciding among three options.
-
After selecting a winner and launching it to all traffic, how do you forecast future conversion rates?
- Describe a principled statistical method to produce a forecast with an uncertainty interval.
- Identify factors that could cause the production conversion rate to diverge from the experimental result (composition shifts, seasonality, novelty decay, instrumentation differences, etc.).
- Explain your post-launch monitoring plan: what metrics, guardrails, and alert thresholds would you establish to detect when the forecast breaks down?
Hints
Hint 1
For observational causal inference, the identification strategy should match the rollout structure—staggered adoption suggests difference-in-differences, universal launch suggests interrupted time series with ML-based counterfactuals.
Hint 2
With three variants, naively doing three pairwise t-tests inflates your false positive rate. Use Bonferroni, Holm, or Bayesian posterior probabilities to account for multiple comparisons.
Hint 3
Post-launch conversion rates often differ from experiment results due to changes in user composition, time-of-day mix, novelty effects wearing off, or concurrent product changes. Build a monitoring framework that separates signal from noise.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
Part A: Causal inference from observational data
1. Define the estimand precisely
Start by specifying exactly what causal quantity you want to measure. For a universal rollout where all users eventually receive the treatment, the natural target is the average treatment effect on the treated (ATT): the incremental impact on those who were exposed.
Make it concrete with units, time windows, and metric definitions. Example: "The incremental weekly purchase rate (purchases per 1,000 users per week) during the first 12 weeks post-launch, among users exposed to the new recommendation algorithm, compared to the counterfactual outcome they would have experienced without the change."
Also identify key guardrail metrics: engagement, retention, revenue per user, and any fairness or safety indicators relevant to your domain.
2. Choose the identification strategy based on rollout structure
The causal inference approach depends on how the change was deployed:
| Rollout pattern | Method | Counterfactual source |
|---|---|---|
| Staggered by geography, channel, or time | Difference-in-differences or staggered DiD (Callaway-Sant'Anna) | Not-yet-treated units serve as controls |
| A few treated units, many untreated aggregates | Synthetic control | Weighted combination of untreated units mimics pre-treatment trend |
| Universal launch at time T, no holdout | Interrupted time series or Bayesian structural time series | Pre-period data plus unaffected covariates forecast the counterfactual |
| Assignment by a cutoff score | Regression discontinuity | Units just below the threshold approximate those just above |
| Partial or self-selected adoption | Inverse propensity weighting or doubly robust estimation | Matched non-adopters after controlling for selection |
Example: ML-based counterfactual for a universal launch. Train a forecasting model on pre-launch data only, using:
- Calendar features (day of week, holidays, month)
- Macroeconomic indicators or external trends
- Control series the change cannot affect (metrics from unrelated products, regions not using the feature, offline channels)
Forecast the post-launch period. The treatment effect is observed outcome minus predicted counterfactual, aggregated over the evaluation window. Construct uncertainty intervals via bootstrap resampling or the model's posterior distribution.
3. State identification assumptions explicitly
Every observational method rests on untestable assumptions. Be transparent:
- Parallel trends / stable relationships: Without treatment, the treated units would have evolved like the controls, or the pre-period covariate-outcome relationship would have persisted.
- No anticipation: Behavior did not change before the official launch date.
- Unaffected controls: Covariates and donor units are not themselves influenced by the treatment.
- No interference (SUTVA): One unit's treatment does not affect another's outcome. Violated in two-sided marketplaces, social networks, or when treatment affects shared resources.
- No concurrent shocks: No other major changes (pricing, marketing campaigns, competitor moves) coincided with the launch.
- Overlap and no unmeasured confounding (for propensity methods): Treatment and control groups are comparable on observed covariates, and no hidden confounders drive both treatment assignment and outcomes.
- Continuity and no manipulation (for regression discontinuity): The outcome is smooth at the cutoff, and units cannot precisely manipulate their score to cross the threshold.
4. Threats to validity
- Confounding from strategic rollout: Teams often launch first in high-performing segments, biasing estimates upward.
- Selection effects: The change itself may alter who engages (e.g., a new approval model shifts the applicant mix).
- Concurrent events: Seasonal patterns, holidays, or simultaneous launches contaminate the effect.
- Network interference and spillovers: Treated users interact with controls, causing bias in both directions.
- Novelty and learning: Initial excitement fades, or users learn to exploit the feature over time.
- Instrumentation drift: Logging or metric definitions changed alongside the feature.
- Outcome lag: Long-term outcomes (e.g., loan default, customer lifetime value) take months to materialize, so early metrics are incomplete.
- Specification search: Trying many models until one produces a favorable result inflates false positives.
5. Validation techniques
- Placebo tests in time: Pretend the launch happened at earlier dates in the pre-period. Estimated effects should be near zero.
- Placebo tests in space: For synthetic control, run the method on each donor unit as if it were treated. The true treated unit's effect should be an outlier in this distribution.
- Negative control outcomes: Choose metrics the intervention logically cannot affect. They should show no effect; if they do, something else is driving the signal.
- Event study plots: Estimate treatment effects at each time period before and after launch. Pre-period effects should be flat (validating parallel trends).
- Counterfactual backtesting: Evaluate forecast accuracy on held-out pre-period windows. The estimated effect must exceed typical forecast error.
- Sensitivity analysis:
- How strong would an unmeasured confounder need to be to eliminate the effect? (E-values, Rosenbaum bounds)
- Vary donor pools, covariate sets, bandwidths, or model specifications and check stability.
- Triangulation: Use multiple methods (e.g., DiD and synthetic control). Do they agree? Compare to a similar past intervention that was A/B tested.
- Pre-registration: Lock in the estimand, time window, model specification, and inference approach before examining post-period data.
6. Short-term versus long-term impact
Early effects can reflect novelty, learning curves, or demand timing shifts rather than steady-state impact. Longer-term outcomes (retention, lifetime value, credit default) mature slowly.
Strategies to separate transient from sustained effects:
- Event study by time since exposure: Plot treatment effects week by week. Look for decay, stabilization, or growth.
- Check for demand shifting: If an initial spike is followed by a dip, users may be pulling forward planned activity rather than generating new behavior.
- Surrogate endpoints: Use early signals (e.g., first-week engagement, early payment behavior) validated on historical cohorts to predict long-run outcomes. This assumes surrogates capture the full causal pathway.
- Cohort tracking: Follow exposed cohorts until outcomes fully mature. Compare to historical cohorts or a small holdout if available.
- Small long-term holdout: If feasible within legal and ethical constraints, hold back 1–5% of traffic indefinitely. It is the gold standard for measuring sustained effects.
Additional data needs:
- Extended pre-period history (at least 2–3 times the post-period length for time-series methods).
- Matured outcomes from past cohorts to train surrogate models.
- Macroeconomic indicators and competitor activity.
- A change log of all other concurrent launches.
Part B: Three-arm conversion test
1. Point estimates and uncertainty
For each treatment, compute the conversion rate and construct confidence intervals. With binary outcomes and moderate sample sizes, use Wilson score intervals (more accurate than normal approximation):
| Treatment | Visits | Purchases | Conversion | 95% Wilson CI |
|---|---|---|---|---|
| A | 150 | 43 | 28.7% | [22.0%, 36.4%] |
| B | 200 | 48 | 24.0% | [18.6%, 30.4%] |
| C | 100 | 15 | 15.0% | [9.3%, 23.3%] |
Standard error (for reference): SE = √(p(1−p)/n). For A, SE ≈ √(0.287 × 0.713 / 150) ≈ 0.037.
2. Overall test for any difference
Perform a chi-square test on the 3×2 contingency table (three treatments, two outcomes: purchase vs. no purchase). This tests whether any treatment differs from the others.
- Pooled conversion rate: 106 / 450 ≈ 23.6%
- Chi-square statistic ≈ 6.26, df = 2, p ≈ 0.044
At least one treatment differs, but this does not identify which.
3. Pairwise comparisons with multiple-testing correction
Compute differences in proportions for all pairs:
| Comparison | Difference | SE | z | Unadjusted p |
|---|---|---|---|---|
| A − B | +4.7 pp | 4.77 | 0.98 | 0.33 |
| A − C | +13.7 pp | 5.14 | 2.66 | 0.008 |
| B − C | +9.0 pp | 4.68 | 1.92 | 0.054 |
With three comparisons, apply Bonferroni or Holm correction. Bonferroni threshold: α/3 ≈ 0.0167.
- A vs. C: p = 0.008 < 0.0167 → statistically significant. A is clearly better than C.
- A vs. B: p = 0.33 → no significant difference, but A has higher point estimate.
- B vs. C: p = 0.054 → not significant after correction.
4. Bayesian perspective (optional but recommended)
Assume uniform priors on each conversion rate. With beta-binomial conjugacy:
- A ~ Beta(44, 108)
- B ~ Beta(49, 153)
- C ~ Beta(16, 86)
Simulate 100,000 draws from each posterior. Compute:
- P(A is best) ≈ 83%
- P(B is best) ≈ 16%
- P(C is best) ≈ 1%
Expected regret from choosing A (expected loss versus the true best arm) ≈ 0.4 percentage points.
5. Decision
- Eliminate C: Significantly underperforms A.
- A is the probable winner but not decisively proven better than B with this sample size.
To detect a 4.7 pp difference between A and B with 80% power (α = 0.05), you need roughly 1,400 visits per arm—much larger than current sample sizes.
Recommendation depends on cost of errors:
- If launching the wrong variant is expensive (engineering cost, user trust), collect more data or use the Bayesian decision rule (expected regret < threshold).
- If speed matters and incremental gain is valuable, launch A with close monitoring.
6. Post-launch forecasting
Method: Use the experimental conversion rate as the baseline forecast, but model uncertainty as a posterior predictive distribution. With a beta-binomial model:
- Posterior for A: Beta(44, 108)
- For N future visits, the number of conversions follows a beta-binomial distribution.
- Credible interval: draw from the posterior, then simulate conversions given those rates.
Example: for 10,000 future visits under A, the median forecast is ~2,870 conversions, with a 95% credible interval of [2,600, 3,150].
Factors causing divergence between experiment and production:
- Traffic composition shift: Experimental users may differ from the broader population in device type, geography, time-of-day distribution, or intent.
- Seasonality and calendar effects: Experiments often run during specific weeks; full launch spans different seasonal patterns.
- Novelty decay: Users' excitement or exploration behavior during the test may not persist long-term.
- Ramp effects: Gradual rollout may introduce learning or adaptation dynamics.
- Instrumentation differences: Production logging pipelines may differ from experimental tracking.
- Concurrent changes: Other features, pricing, or marketing campaigns launching simultaneously.
- Network effects: If the experiment was small, full launch may change user behavior via social or marketplace dynamics.
Monitoring and validation plan:
- Daily dashboard: Track conversion rate, visit volume, and secondary metrics (average order value, bounce rate).
- Sequential testing: Use sequential probability ratio tests or Bayesian updating to detect shifts early without waiting for fixed sample sizes.
- Segmentation: Monitor conversion across user segments, devices, and geographies to detect composition shifts.
- Guardrail alerts: Set thresholds (e.g., conversion drops below the lower bound of the forecast interval for 3 consecutive days) triggering investigation.
- Residual diagnostics: Plot observed minus forecast over time. Large residuals indicate model breakdown.
- Recalibration: After 2–4 weeks, refit the forecast model using early production data to update the baseline.
The goal is not to match the experimental estimate exactly but to detect and understand meaningful deviations quickly.