ds@mcpanalytics.aiEmail your data and your question and get an answer about your own data, with the method shown.Email your data and question. Get an answer.

Causal Inference Methods: Complete Guide to Measuring What Actually Works

By MCP Analytics Team | Published , updated

Correlation is not causation. Everyone knows this. Very few people know what to do about it. When your marketing campaign runs at the same time revenue spikes, did the campaign cause the spike, or was it seasonal demand? When customers who use your premium feature churn less, is the feature reducing churn, or do loyal customers just happen to use more features?

Causal inference methods answer these questions rigorously. They are the difference between "these two things moved together" and "this thing caused that thing." This guide covers methods from the gold standard (randomized A/B tests) to quasi-experimental methods for situations where you cannot randomize. Each section tells you when a method works, when it fails, and links to a full deep-dive article.

Find the method for your question

Start with the question you are asking. Each guide says when its method does not fit.

Your questionMethodPage
Can I randomly assign who gets the change?A/B testingRead the guide
I want the chance that one version is better, not a p-value.Bayesian A/B testingRead the guide
One group changed and another did not, and I have before and after data for both.Difference-in-differencesRead the guide
Treated and untreated people differ, and I want to compare similar ones.Propensity score matchingRead the guide
Something nudges who gets treated but affects the outcome only through that.Instrumental variablesRead the guide
Who gets treated depends on a cutoff.Regression discontinuityRead the guide
One market changed and I have related series that did not.Causal ImpactRead the guide
One treated unit and several untreated ones to build a comparison from.Synthetic controlRead the guide
I randomized but want to adjust for a measure taken before the test.ANCOVA / CUPEDRead the guide

A Worked Example: Difference-in-Differences on Made-Up Data

This example shows one method of the many listed below. It is not representative of the other methods, and the data are made up. For the method itself, see the difference-in-differences guide.

Question: Did a new feature raise weekly orders per account for the accounts that got it, compared with accounts that did not?

Inputs: Simulated weekly orders for 80 accounts in each group, before and after the change. The groups start at different levels on purpose (about 20 and 18 orders). Both groups are set to rise by 1.5, and the group with the feature gets 3.0 more. Noise is added in both periods. Seed 31415.

Method: Difference-in-differences compares two changes: the change in the group that got the feature and the change in the group that did not. It assumes the groups would have had alike trends if there were no feature. The standard error shows how much the estimate would be expected to move with a different sample.

import numpy as np

SEED = 31415
rng = np.random.default_rng(SEED)
n = 80
common_time_change = 1.5
simulated_effect = 3.0
t_base = rng.normal(20.0, 4.0, n)
c_base = rng.normal(18.0, 4.0, n)
t_before = t_base + rng.normal(0.0, 2.0, n)
c_before = c_base + rng.normal(0.0, 2.0, n)
t_after = (t_base + common_time_change + simulated_effect
           + rng.normal(0.0, 2.0, n))
c_after = (c_base + common_time_change
           + rng.normal(0.0, 2.0, n))

t_change = t_after - t_before
c_change = c_after - c_before
did = t_change.mean() - c_change.mean()
se = np.sqrt(t_change.var(ddof=1) / n + c_change.var(ddof=1) / n)

print(f"Simulated data, seed {SEED}; weekly orders per account, "
      f"{n} accounts in each group")
print("Built in: both groups rise by 1.5; "
      "the group with the feature gets 3.0 more")
print(f"Feature group: before {t_before.mean():.3f}, "
      f"after {t_after.mean():.3f}, change {t_change.mean():.3f}")
print(f"Other group: before {c_before.mean():.3f}, "
      f"after {c_after.mean():.3f}, change {c_change.mean():.3f}")
print(f"Difference-in-differences estimate: {did:.3f} orders per "
      f"account (standard error {se:.3f})")
print(f"Rough 95% range: {did - 1.96 * se:.3f} to "
      f"{did + 1.96 * se:.3f}")
Simulated data, seed 31415; weekly orders per account, 80 accounts in each group
Built in: both groups rise by 1.5; the group with the feature gets 3.0 more
Feature group: before 20.228, after 24.146, change 3.918
Other group: before 17.802, after 19.429, change 1.627
Difference-in-differences estimate: 2.292 orders per account (standard error 0.505)
Rough 95% range: 1.301 to 3.282

Result: The group with the feature rose by 3.92 orders per account and the other group by 1.63, so the difference-in-differences estimate is 2.29 (range 1.30 to 3.28). The data were built with an effect of 3.0 and the same trend in both groups, so this shows the method on data where its main assumption (alike trends) holds by construction. The range includes 3.0, but the estimate is below it, which is what noise of this size does.

Limit: Code made the data. The example cannot show whether real groups would have had alike trends, and it does not show the effect of a real feature.

Sources

  • Brodersen KH, Gallusser F, Koehler J, Remy N, Scott SL (2015). Inferring causal impact using Bayesian structural time-series models. Annals of Applied Statistics 9(1): 247-274. doi:10.1214/14-AOAS788. Covers: who proposed Causal Impact and when, and its use of a Bayesian structural time series model.

Quick Comparison

Method Best For Requires Randomization? Guide
A/B Testing Digital experiments with full control over assignment Yes Full guide
Bayesian A/B Testing A/B tests with early stopping or unequal groups Yes Full guide
Difference-in-Differences Policy changes, feature rollouts to subgroups No Full guide
Propensity Score Matching Observational data where treatment is self-selected No Full guide
Instrumental Variables Endogeneity problems, omitted variable bias No Full guide
Regression Discontinuity Treatment assigned by a threshold (score, date, age) No Full guide
Causal Impact Time series interventions (launch, campaign, policy) No Full guide
Synthetic Control Single-unit interventions with comparison units No Full guide
ANCOVA Treatment effects with pre-treatment covariate adjustment Either Full guide

Method Deep-Dives

1. A/B Testing (Frequentist)

The question it answers: Did variant B actually outperform variant A, or was it random noise?

A/B testing is the gold standard for causal inference because randomization eliminates confounders by design. You randomly assign users to control and treatment, measure the outcome, and run a statistical significance test. If you can randomize, always start here. The method is straightforward, well-understood, and produces the most defensible results. The catch: you need enough traffic or conversions for statistical power, and you need to resist peeking at results before the test reaches its planned sample size.

Use when: You control the user experience and can randomly assign users to different versions (website, email, pricing, features).

Read the full A/B testing guide →

2. Bayesian A/B Testing

The question it answers: What is the probability that B is better than A, and by how much?

Bayesian A/B testing gives you something frequentist tests cannot: a direct probability statement. Instead of "we reject the null hypothesis at p < 0.05," you get "there is an 94% probability that B outperforms A by at least 3%." This is more intuitive for decision-makers. Bayesian methods also handle early stopping naturally -- you can check results at any time without inflating error rates. The tradeoff is that you need to specify a prior, and computation is more involved.

Use when: You want to stop tests early, have unequal group sizes, or need probability statements your stakeholders can actually understand.

Read the full Bayesian A/B testing guide →

3. Difference-in-Differences (DiD)

The question it answers: What was the effect of a change that only affected some groups?

DiD is the workhorse of quasi-experimental methods. When you roll out a feature to one region but not another, change pricing for one segment, or launch a campaign in some markets, DiD measures the causal effect by comparing the change in outcomes for the treated group versus the control group. The key assumption is parallel trends: absent the treatment, both groups would have followed the same trajectory. DiD is powerful because it does not require randomization, only a plausible comparison group.

Use when: You have before-and-after data for both a treated group and a comparable untreated group.

Read the full DiD guide →

4. Propensity Score Matching

The question it answers: What would have happened to these treated individuals if they had not been treated?

When treatment is self-selected (customers who chose to use a feature, users who opted into a program), you cannot simply compare treated to untreated because the groups differ systematically. Propensity score matching creates an artificial control group by matching each treated individual to an untreated individual with similar characteristics. This makes the groups more alike on the factors that were measured. It cannot fix key factors that were not measured. The method requires rich covariates -- the more you know about what drives selection, the better the match.

Use when: You have observational data, treatment was not randomized, and you have rich data about the factors that influenced who received treatment.

Read the full propensity score matching guide →

5. Instrumental Variables (IV)

The question it answers: What is the true causal effect when there are unmeasured confounders?

IV is the method you reach for when you suspect your estimate is biased by something you cannot measure. It uses a third variable (the "instrument") that affects the treatment but has no direct effect on the outcome. Classic examples: distance to a college as an instrument for education's effect on earnings, or weather as an instrument for foot traffic's effect on sales. Finding a valid instrument is the hard part -- if your instrument violates the exclusion restriction, the estimate is worse than OLS.

Use when: You suspect omitted variable bias and can find a credible instrument. This is an advanced method -- use it when simpler alternatives (DiD, matching) are not feasible.

Read the full IV guide →

6. Regression Discontinuity (RD)

The question it answers: What happens right at the threshold where treatment kicks in?

RD exploits situations where treatment is assigned based on a cutoff: customers who spend above $100 get a loyalty discount, students scoring above 70 get into the honors program, ads shown to users over age 25. Near the cutoff, assignment is almost random -- a customer at $101 is nearly identical to one at $99. RD estimates the causal effect by comparing outcomes just above and just below the threshold. It can support a cause-and-effect estimate near the cutoff. This needs people not to sort themselves around the cutoff, and checks on the data must also back the key claim.

Use when: Treatment is assigned by a numeric threshold and you have dense data near the cutoff.

Read the full RD guide →

7. Causal Impact Analysis

The question it answers: What would have happened to this time series if the intervention had never occurred?

Causal Impact compares what happened with a forecast built from related series that the change did not touch (Brodersen et al., 2015). It uses a Bayesian structural time series model, as the title of that paper says. A typical question: you launched a campaign on March 1, and you want to know if the revenue lift was caused by the campaign or was going to happen anyway. The method requires control series (related time series unaffected by the intervention) to build the counterfactual.

Use when: You have a time series interrupted by an event (campaign launch, policy change, feature release) and comparable control series.

Read the full Causal Impact guide →

8. Synthetic Control

The question it answers: What would have happened to this single treated unit without the intervention?

Synthetic control is designed for the common case where you only have one treated unit: one state passed a law, one store got renovated, one country changed policy. It constructs a weighted combination of untreated units that best matches the treated unit's pre-intervention trajectory. The synthetic version serves as the counterfactual. The method is transparent -- you can see exactly which comparison units contribute and how much -- and produces visual results that are easy to explain to non-technical stakeholders.

Use when: You have a single treated unit and a pool of comparable untreated units with pre-intervention data.

Read the full synthetic control guide →

9. ANCOVA (Analysis of Covariance)

The question it answers: What is the treatment effect after adjusting for pre-treatment differences?

ANCOVA combines ANOVA with regression to estimate treatment effects while controlling for covariates. In A/B testing, ANCOVA with pre-treatment outcome as a covariate (often called CUPED in tech) can reduce variance and increase statistical power. This means you can detect the same effect with fewer observations, or detect smaller effects with the same sample size. ANCOVA works for both randomized experiments and observational studies.

Use when: You have pre-treatment data on the outcome variable and want more precise treatment effect estimates, or when groups differ on important covariates.

Read the full ANCOVA guide →

Decision Guide: Which Method Do You Need?

Can you randomize? │ ├─ YES: You can assign users randomly │ ├─ Want frequentist significance test? │ │ └─ A/B Testing │ ├─ Want probability of B > A, or early stopping? │ │ └─ Bayesian A/B Testing │ └─ Want to reduce variance with pre-treatment data? │ └─ ANCOVA / CUPED │ └─ NO: Treatment was not randomly assigned │ ├─ Do you have before/after data + a comparison group? │ └─ Difference-in-Differences │ ├─ Is treatment assigned by a numeric threshold? │ └─ Regression Discontinuity │ ├─ Do you have rich covariates about who got treated? │ └─ Propensity Score Matching │ ├─ Is this a time series with an intervention point? │ ├─ Multiple comparison series available? │ │ └─ Causal Impact │ └─ Single treated unit + pool of comparison units? │ └─ Synthetic Control │ └─ Do you have a credible instrument? └─ Instrumental Variables

How These Methods Relate

Causal inference methods differ in how much they rely on assumptions:

  1. Randomized experiments (A/B testing, Bayesian A/B) -- the gold standard. Randomization eliminates confounders by design.
  2. Quasi-experimental methods (DiD, RD, synthetic control, causal impact) -- exploit natural variation or policy changes to approximate randomization. Strong when assumptions hold.
  3. Matching and adjustment methods (propensity scores, ANCOVA, IV) -- use statistical techniques to adjust for confounders. Quality depends entirely on having the right covariates or instruments.

In practice, most businesses start with A/B testing for digital experiments and use DiD or Causal Impact for interventions that cannot be randomized (pricing changes, market launches, policy shifts). Propensity score matching fills the gap when you have observational data and rich customer profiles. The other methods are specialized tools for specific situations.

Causal Inference for Business Decisions

All Causal Inference Guides

Your turn

Bring your own data and the question you actually need answered.

MCP AnalyticsData science by email Send us your data and your question, and we will reply. ds@mcpanalytics.ai