Frame first. Then model.

propensity_lift estimates brand lift from exposed-versus-control survey data. This guide covers the package, and the decisions that have to be made before you run it.

+25raw difference, points
+7after reweighting
+8true effect (known: the data are simulated)

A propensity model does not know what question you asked.

If you build response or targeting models, the mechanics here are familiar: a classifier, a score, some weights. What changes is the job. A targeting model succeeds by predicting exposure well. A propensity analysis succeeds when the comparison it sets up is fair, and a model that predicts exposure too well is a sign that no fair comparison exists.

When observational ad measurement was checked against experiments, it missed badly.

These studies had far richer data than a survey and still went wrong, because the variables that drove exposure were not in the data. The estimator was rarely the weak point.

160×

Lewis, Rao and Reiley (2011). A randomised test measured a 5.4% effect on brand searches. Regression with every available control said 872%.

7 of 14

Gordon et al. (2019). In seven of the 14 Facebook experiments with a checkout outcome, the observational estimates were off by more than a factor of three.

173% vs 29%

Gordon, Moakler and Zettelmeyer (2023). Over 663 experiments, the median upper-funnel lift from stratified propensity score matching, against the median lift the experiments measured.

Read the case-study notes Experimental benchmarks

One call runs the whole analysis.

Give it a respondent-level table and a config. It fits the propensity model, checks overlap, applies every adjustment method you asked for, and reports lift for each KPI with diagnostics next to every number.

from propensity_lift import AnalysisConfig, load_table, run_analysis

df = load_table("survey.xlsx")
cfg = AnalysisConfig(
    dataset_id="survey",
    treatment_column="group", exposed_values=["Exposed"], control_values=["Control"],
    outcome_columns=["aided_awareness", "favorability", "consideration"],
    model_features=["age", "social_media_hours_day", "prior_brand_usage"],
    methods=["nn_matching", "ipw", "overlap_weights", "aipw"],
    estimand="ATT",
)
result = run_analysis(df, cfg)