Skip to content
Marketing Measurement Science

Propensity Scores, Matching, and Weighting

Customers who join a loyalty program often spent more and ordered more frequently before joining. Matching and weighting use measured characteristics from before treatment to build a more comparable group, and balance diagnostics show how much of the measured differences remain. Unmeasured confounders can still bias the estimate.

Propensity scores

A propensity score is the probability that a unit receives treatment given its observed covariates. Here, T indicates treatment and X represents the observed characteristics.

e(X) = P(T = 1 | X)

In observational studies, a model such as logistic regression or gradient-boosted trees estimates these probabilities. Matching pairs treated and comparison units with similar scores, stratification groups units into score ranges, weighting reweights units using their treatment probabilities, and regression adjustment includes the score as a covariate.

A score of 0.7 means the model estimates a 70% chance that a unit with those characteristics receives treatment. Similar scores indicate similar estimated chances of treatment. Check overlap and balance on the measured covariates before relying on the comparison.

Overlap

Common support means units in the target population have a meaningful chance of appearing in either the treated or comparison group. This simulated box plot illustrates what poor and good overlap can look like.

Treated Comparison 0.0 0.2 0.4 0.6 0.8 1.0 Propensity score

Scroll the plot to see the full score range.

With poor overlap, the matching caliper can leave treated units without a comparison, and weighting can give a few units very large weights. The matching tool below reports how many loyalty members had no non-member within the selected caliper.

What to match on

Use characteristics measured before the index date, when the comparison starts. The program can change spending or ordering after that date, so matching on those later measures could remove part of the effect you want to estimate.

In real data, members join on different dates. A control must have been eligible to join and still a non-member on the matched member’s index date. Use the same baseline and follow-up windows for both. Otherwise, a seasonal swing or a longer follow-up for one group can show up as a spending difference.

Some controls will join later. Decide in advance whether to end their control follow-up when they join or keep them in the original group, and report that choice. If they stay in, the estimate compares joining on that date with not having joined yet, and some of the comparison group will be members by the end of follow-up. Choosing controls based on whether they eventually join uses information from after the index date.

This simulated cohort has 3,000 customers. Every member joined in the same month. Every non-member was eligible and had not joined by then, and nobody joined during the six-month follow-up. The recorded characteristics are six-month average spend, spend in the last of those months, orders per month, months as a customer, and whether the customer is in the West region. Joining was more likely after an unusually high month of spending.

Worked match with four candidates

CustomerSix-month spend ($/mo)Orders per monthMonths as a customerSpend gap onlyStandardized distance
Member1203.030——
Candidate A1181.08$22.22
Candidate B952.634$250.76
Candidate C1313.327$110.42
Candidate D1603.031$401.00

The standard deviations in this hand calculation are chosen for easy arithmetic ($40 for monthly spend, 1.2 orders per month and 15 months of tenure). Divide each gap by its standard deviation, square the three results, and take the square root of their sum. For C, that gives √[(11/40)² + (0.3/1.2)² + (3/15)²] ≈ 0.42. The cohort tool calculates its own standard deviations from all members and non-members.

Candidate A spends almost the same amount as the member, but orders once a month and has been a customer for eight months. On spend alone, A is closest. Once orders and tenure count, A is farthest and C is closest. The Mahalanobis option below also accounts for correlations among characteristics.

To compare spending changes after forming a matched group, use the loyalty DiD calculator.

Match the cohort

In the simulated 3,000-customer loyalty cohort, members are matched one at a time, starting with those with the highest estimated probability of joining. Customer ID breaks ties. Each member gets the nearest non-members the settings allow. A member who gets at least one control stays in the analysis, even if the setting asks for three.

The Love plot shows standardized mean differences (SMDs) for each characteristic before and after matching.

The dashed lines at ±0.1 are a common rule of thumb for flagging imbalance. They are not a statistical test. A characteristic inside the lines can still differ in spread, which the variance ratio column shows. Balance on measured characteristics says nothing about unmeasured ones.

How balance is calculated

Each standardized mean difference (SMD) divides the member-minus-non-member mean difference by the pooled standard deviation. The pooled standard deviation is the square root of the average of the two full groups’ sample variances. The same denominator is used before and after matching. Only the logit-score denominator changes with the baseline setting, because that setting refits the score model.

The variance ratio divides the matched members’ variance by the matched non-members’ weighted variance. Both are mean squared deviations within the matched group. Ratios are shown for continuous measures only.

ATT is the average effect of the program on all members. ATTM is the average effect on the members matched under the current settings, so it can change when the settings change who gets a match. The simulation knows both because it records each member’s spend with and without the program. In real data, only one of those is observed.

How the matched estimates are calculated

With membership denoted by T and receiving at least one control by M, ATT is E[Y(1) − Y(0) | T = 1] and ATTM is E[Y(1) − Y(0) | T = 1, M = 1].

For each matched member, subtract the average change among that member’s controls from the member’s change. Then average those differences, giving each matched member equal weight.

ATT̂MDiD = (1 / NM) Σi∈M [ΔYi − (1 / ki) Σj∈Ci ΔYj]

NM is the number of matched members, Ci is the set of controls for member i, and ki is the number in that set. ΔY is average monthly spend after the index date minus the selected baseline. For the matched post-join difference, use post-index spend in place of ΔY. The before-matching estimates are differences of simple means over all members and all non-members.

Each time a non-member is chosen for member i, it receives weight 1/ki. Add those shares across members to get that non-member’s total weight wj. The balance table uses these weights for the matched non-member means and variances. The effective sample size (ESS) of the controls is (Σw)² / Σw².

A post-join comparison can still reflect differences in how much the groups would have spent without the program. DiD subtracts the baseline gap. If the matched groups would have changed by different amounts without the program, that difference in changes still enters the estimate. See parallel trends.

What each setting changes

Distance. The propensity option matches on the log odds (logit) of the score estimated from baseline spend, orders, tenure and West region. Mahalanobis distance matches directly on those characteristics using their pooled within-group covariance. It works best with a few characteristics, because with many of them close matches become rare.

Caliper. With either distance, a caliper rules out controls whose logit score differs from the member’s by more than the chosen number of pooled standard deviations. The pooled SD comes from all members and non-members before matching. A tighter caliper can change which controls are chosen and which members get a match. Compare the known ATTM across settings to see whether the target moved. The last column shows how far the estimate is from that target.

Controls per member and replacement. Without replacement, each control is used once. Members matched later can get farther-away controls as the closest ones are taken. Reusing a close control can improve balance. When a few controls carry much of the weight, the effective sample size falls below the number of distinct controls. Taking three controls can improve precision, but the additional controls are at least as far away and may worsen balance.

Baseline spend. This setting changes the spend measure used for matching and the baseline subtracted in DiD. Spending after an unusually high month tends to fall back toward the customer’s usual level. If members had the larger spike, using that month as the baseline can pull the estimate down. If controls had the larger spike, it can push the estimate up. In this cohort, the decision to join depended more on usual spending than on a single high month. Two customers can have similar spending in the last month even if it reflects a one-time purchase for one customer and typical spending for the other.

Separate the matching and DiD baselines

Read across a row to change the DiD baseline while keeping the same matches. Read down a column to change the spend measure used for matching while keeping the DiD baseline fixed. Each row uses the known effect for the members it matched.

Weighting

In this synthetic cohort of 200 units split equally between two baseline strata, treatment is more common in the high stratum. Reweight each arm toward the same target mix. For propensity e, the ATE weights are 1/e for treatment and 1/(1−e) for control. The ATT uses 1 for treatment and e/(1−e) for control.

Normalize within each arm for the Hájek mean and apply the same effective sample size formula to each arm’s weights. As in the matching balance calculation, divide the mean difference by a pooled, unweighted standard deviation that stays fixed before and after adjustment. Here the pooled standard deviation comes from the unweighted high-stratum proportions in the two arms.

Check overlap before weighting and use the balance guidance to interpret the weighted diagnostics. Clipping changes weights and can bias the target estimate. Trimming excludes units and changes the supported target. A missing treatment arm still requires a restriction or a different design.

Continue to Missing outcomes to add selective follow-up to this cohort.

Missing outcomes

Compare measured-baseline loss with loss driven by an unseen outcome. The cohort, treatment and conversion totals come from a simulation. The true effect is visible here for checking what each estimator recovers. Missing outcome values would be unknown in a real cohort.

Joint weighting and the augmented arm mean

Use treatment exchangeability and missing at random within treatment and baseline strata, with treatment and observation support and a well-defined outcome for all target units. Equal attrition rates are compatible with outcome-dependent selection.

For arm d, joint weights divide the treatment weight by the observed fraction πd in that arm and baseline stratum. For the ATE this is 1/(pdπd). The augmented ATE arm mean averages the working outcome regression μd(X) across everyone and adds the full-cohort average of observed arm residuals divided by pdπd. Other units contribute zero to that correction. For ATT, this example standardizes target predictions and corrections to the treated baseline mix.

Under identification, a correct outcome regression or a correct joint probability can give a consistent ATE estimate. Efficiency and inference also depend on estimation rates and other regularity conditions. These two-stratum estimates use empirical cell probabilities, so the untruncated joint weighting and augmentation agree algebraically.

For an outcome-dependent loss replay, see Threats to the offer estimate. Binary bounds cover possible values of the realized full-cohort contrast. Population inference also needs sampling uncertainty. Heckman Selection Correction models selection under a different set of assumptions.

Uncertainty

Matching. With replacement, matched sets that share a control are dependent. For nearest-neighbor matching with replacement and a fixed number of controls per member, the ordinary bootstrap does not give valid standard errors in general. The Abadie–Imbens variance estimator accounts for reused controls. After matching without replacement, regression standard errors clustered on matched sets can be valid when there is overlap and the matches get closer as the sample grows, as shown by Abadie and Spiess.

Weighting. Estimated propensities can improve precision in some designs. Standard errors that treat weights as fixed can be conservative or anticonservative. In a bootstrap, resample independent units or clusters and refit the full procedure. A regression that residualizes treatment adequately can implicitly weight heterogeneous effects by treatment variance.

Explore spending changes after matching in the loyalty DiD calculator.