Statistics & probability

Synthetic control calculator with donor weights and placebo gaps

Fit convex donor weights before intervention and compare later treated-unit gaps with donor placebos.

Your numbers

Valid JSON.
Valid JSON; preserve the shown array or object structure.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

A synthetic control is a weighted combination of untreated units selected to resemble the treated unit before an intervention. Nonnegative weights that sum to one keep the comparison within the donor pool's convex range.

THE FORMULAGiven treated pre-outcome vector y0 and donor matrix X0, solve min_w||D^(1/2)(y0-X0w)||² with w≥0,1^Tw=1 and fixed supplied diagonal time weights D. Use active-set QP or projected-gradient with objective/KKT residual checks; report alternate minimizer risk if singular. Predict post X1w and gaps y1-X1w. For each donor placebo rerun using other untreated donors only, with donor exclusion policy stated. Report pre/post RMSPE and ratio only when denominator>tolerance. This fixed-outcome-weight variant is not nested predictor-V optimization from every Synth setting.

A worked example

With the prefilled inputs, postMeanGap = 0.

Good to know

Predictive convex weights; donor placebos exclude the original treated unit from their donor pools. Fit quality and intervention assumptions determine causal interpretation; no automatic p-value.

Construct a comparison from donors

A synthetic control is a weighted combination of untreated units selected to resemble the treated unit before an intervention. Nonnegative weights that sum to one keep the comparison within the donor pool's convex range.

Its usefulness depends on donor comparability and a credible untreated counterfactual. A close numerical fit before intervention does not by itself show that post-intervention differences were caused by treatment.

Synthetic-control convex mixturePre-fit donor mixture and post-period gappre-fitpost2Donor weights: 0.5 and 0.5Synthetic post = 3; observed treated post = 5
Scroll across to see the full diagram.
Equal donor weights reproduce treated pre-outcomes(1,1). For a post donor row(2,4), the synthetic outcome is3 and an observed outcome5 gives gap2. Dashed lines are donors and synthetic values; solid line is treated.

Compare with the Weighted polynomial regression calculator. Fit convex donor weights to a treated-unit preintervention path and compare postintervention outcomes; regression fitting has no donor-simplex counterfactual contract.

Separate pre and post periods

Use the prefilled input structure and preserve the declared column or index order. Only pretreatment observations determine the donor weights. Post-treatment outcomes evaluate the fitted comparison and must not be used to choose weights simply because they produce a desirable effect estimate.

Arrange periods consistently across all units and state any preprocessing. A missing donor observation cannot be replaced with zero without changing the comparison; incomplete data need an explicit treatment policy. The first column is the treated unit, followed by two to fifteen donor units observed at the same ordered periods. The declared preperiod count splits the rows; at least one later period is required. Positive period weights affect the preintervention fitting objective only. They do not authorize the optimizer to inspect postintervention outcomes while selecting donor weights. An exact fit can be achieved in several ways when donors are redundant, so a displayed weight vector need not be unique. The fitted synthetic series and gap series are usually more informative than ranking individual donor weights as if they were causal contributions.

Understand the constrained fit

The objective minimizes weighted squared pretreatment discrepancies while respecting the simplex constraints. A negative donor weight would extrapolate outside the supported donor mixture and is excluded in this specification.

Several weight vectors can fit equally well when donors are redundant. Report optimization residuals and uniqueness limitations instead of implying that every displayed donor contribution is separately identified.

Calculate gaps after fitting

For each post period, multiply donor outcomes by the fitted weights and sum them. The estimated gap is the treated outcome minus that synthetic outcome, with the sign convention retained throughout the tables.

Pre-fit and post-fit root-mean-square prediction errors summarize different stages. A ratio involving zero pretreatment error is undefined; it must not be silently turned into an ordinary finite evidence score.

A two-donor arithmetic check

Suppose pretreatment donor rows are(0,2) and(2,0), while the treated outcomes are(1,1). Equal weights of one-half reproduce both pretreatment observations exactly.

If the next donor row is(2,4), the synthetic outcome is three. A treated outcome of five then gives a gap of two, but the post/preRMSPE ratio has a zero denominator in this exact example.

Use placebo comparisons carefully

A donor-placebo analysis repeats the construction with an untreated donor acting as if it had been treated. Its donor pool and fit rules should be comparable, and actual treated outcomes should not contaminate that pool.

Poor pretreatment fits can make placebo gap comparisons misleading. Retain the fit-quality information and any prespecified exclusion rule rather than showing only a convenient ranking of post-treatment gaps.

Assess the substantive counterfactual

Check for spillovers, anticipation, concurrent shocks and changes in measurement. Those features can break the donor comparison even when the optimization converges perfectly.

This calculation estimates a transparent weighted counterfactual under the selected inputs. It cannot supply the historical design argument needed to interpret the observed difference as an intervention effect. Each donor placebo is refitted as if that donor had been treated, excluding the original treated unit from its donor pool. Otherwise the original treatment effect could leak into the placebo's later synthetic prediction. A sole remaining donor still defines a valid constrained fit, including a donor whose preperiod values are all zero. The implementation returns preperiod and postperiod RMSPE separately but does not compute an automatic placebo rank p-value or select a fit-quality exclusion rule. If such a rule is used externally, specify it before inspecting the postperiod comparison and retain the excluded units in an audit record. Predictive convex weights; donor placebos exclude the original treated unit from their donor pools. Fit quality and intervention assumptions determine causal interpretation; no automatic p-value.

A few questions, answered

Can donor weights be negative?

Not in this convex synthetic-control specification; every weight is nonnegative and all weights sum to one.

Why not choose weights using post-treatment data?

That would fit the outcome being evaluated and compromise the intended counterfactual comparison.

What if pre-fit error is zero?

The displayed preperiod RMSPE can be zero for an exact fit. This page reports preperiod and postperiod errors separately; it does not calculate an undefined post/pre ratio.

Is a placebo rank a guaranteed causal p-value?

No. Its interpretation depends on the design, comparability and the way placebo units and fit-quality exclusions were selected.

Find your calculator

Start typing to explore the library.