Propensity score matching for researchers

Free until December 31, 2026

Deterministic. Same data + same settings = same result. Your file never leaves this browser tab.
Overview

Eight steps from raw data to a matched dataset, plus an optional outcome comparison

Propensity score matching builds a control group that resembles your treated group on the characteristics you choose. This widget walks you through it one decision at a time, and explains each decision in plain language.

  1. 1
    Upload dataA CSV, Excel, SPSS (.sav) or .dta file with one row per participant. You get a summary of every variable and any problems to fix.
  2. 2
    Treatment variablePick the variable that says who was treated, and which value means "treated".
  3. 3
    CovariatesTick the pre-treatment characteristics the groups should be balanced on. You choose; nothing is selected for you.
  4. 4
    Propensity scoresA logistic regression estimates each participant's probability of treatment. You see the model and how much the groups overlap.
  5. 5
    Method and settingsNearest-neighbour matching (ratio, caliper, replacement, exact matching, distance), subclassification or weighting, each with a short explanation.
  6. 6
    ResultsSee how many participants were matched and the matched pairs themselves, or the subclasses, or the weights.
  7. 7
    Balance diagnosticsStandardised mean differences before and after matching, a clear verdict, and a Love plot.
  8. 8
    ExportDownload the matched dataset, the balance table, a settings record, and a ready-to-edit methods summary.
  9. 9
    Outcomes (optional)Compare rearrest or reincarceration rates between the matched groups: chi-square, Cohen's d, relative change, and Mantel-Haenszel sensitivity bounds.

How to move around

  • Steps unlock in order, but you can return to any completed step at any time by clicking it in the list on the left.
  • If you change an earlier choice (for example add a covariate or tighten the caliper), everything after it is recalculated from scratch, so results always match the choices shown. You will not lose your data or your other settings.
  • The running tally in the left panel fills in as you go, so you can always see where the sample stands.
  • Every calculation is deterministic: the same file and the same settings give the same result, on any computer. Your data are never sent to a server.
  • A typical session takes 5 to 10 minutes. It is common to run steps 5 to 7 more than once to find settings that give good balance.

How to cite this tool

If you use this tool in your work, please cite it:

AcademiQuery. (2026). Propensity score matching tool (Version 2.0) [Computer software]. https://academiquery.com/tools/psm.html

Step 1 of 8

Upload your data

One row per participant (or unit), one column per variable, with variable names in the first row.

Drop a CSV, Excel, SPSS (.sav) or .dta file here, or click to choose one

.csv, .tsv, .xlsx, .xls, .sav, .zsav, .dta. Nothing is uploaded to a server.

No file at hand? Simulated data on 500 people released from prison, 78 of whom joined a vocational programme; outcomes: rearrest within 12, 24 and 36 months (later follow-ups missing for recent releases). Not real data.

What does this mean?

The widget reads your file and lists every variable it found, with its type (numeric, categorical, and so on) and how many values are missing. Check that the row count matches what you expect and that the variables look right before moving on.

Learn more
  • Missing values are recognised when a cell is empty or contains NA, N/A, NaN, null, none, a lone dot, or a lone hyphen. Any other text inside a numeric column is also treated as missing for that variable.
  • Types are inferred from the data: a column with exactly two distinct values is "binary"; numbers with more than two values are "continuous"; text with up to 30 distinct values is "categorical". You can change how a variable is treated in step 3.
  • The example dataset is simulated. Its treatment variable is vocational_program; sensible covariates are age_at_release, sex, prior_convictions, education, employed_before_prison, offense_type and risk_score. Leave out participant_id (an identifier), sentence_months only if you believe it was fixed before programme entry, and the rearrest_12m, rearrest_24m and rearrest_36m variables, which are outcomes for step 9.
  • ID-like columns (a different value in every row) are flagged because they should never be used as covariates.
  • Rows with missing values on the treatment variable or on any chosen covariate are excluded from the analysis sample (listwise deletion). The number excluded is always reported.
Step 2 of 8

Choose the treatment variable

Select the variable that says who received the treatment, program, or exposure, and tell the widget which value means "treated".

Only variables with exactly two distinct values are listed, because matching needs a treated group and a control group.

What does this mean?

The treated group is the group you want to learn about. The control (comparison) group is everyone who did not receive the treatment. Matching will look for control participants who resemble each treated participant.

Learn more

The procedure implemented here estimates the effect of treatment on the treated (ATT): treated participants are kept as they are, and controls are selected to resemble them. If you swap the two labels, you are asking a different question (who resembles the controls?), so choose carefully.

Participants with a missing value on this variable are excluded from the analysis.

Step 3 of 8

Choose the covariates

Tick the variables that should be balanced between the treated and control groups. The choice is yours: nothing is selected by default.

Only include variables measured before the treatment. A variable that could itself have been affected by the treatment (an outcome, a mediator, anything recorded afterwards) must not be a covariate. Including it removes part of the very effect you want to estimate.

What does this mean?

Covariates are the background characteristics you believe influence both who gets treated and the outcome you care about (for example age, prior record, or baseline severity). The propensity score summarises all of them into one number, so the matched groups will be similar on these variables and not on others.

Learn more
  • Continuous variables enter the model as they are. Categorical variables are converted into indicator (dummy) variables, one per category except a reference category (the first one in sorted order, shown next to the variable).
  • A numeric variable that is really a set of codes (1 = urban, 2 = rural, 3 = mixed) should be switched to categorical.
  • Do not include the outcome, an ID number, or anything measured after treatment began.
  • The model is a standard logistic regression with main effects only. If you need interactions or squared terms, create those columns in your data file first.
  • The analysis sample shown below counts the rows that have complete data on the treatment variable and every ticked covariate.
Step 4 of 8

Propensity scores

Each participant's estimated probability of being in the treated group, given the covariates.

What does this mean?

A propensity score close to 1 means a participant looks very much like the treated group; close to 0 means they look like the control group. Matching works best where the two histograms overlap, because that is where treated participants have comparable controls available. If a large part of the treated group sits where there are no controls, many of them cannot be matched.

Learn more
  • Scores come from a logistic regression of the treatment indicator on the covariates, fitted by maximum likelihood (iteratively reweighted least squares). The coefficients are reported so the model is fully transparent.
  • Common support is the range of scores where both groups are present. Participants outside it are reported but not removed automatically; a caliper (step 5) is the usual way to prevent poor matches there.
  • Very high pseudo R² or scores that cluster at 0 and 1 indicate that a covariate almost perfectly predicts treatment; in that case matching cannot create comparable groups.
  • Coefficients are shown for transparency only. They describe who was more likely to be treated in your data and should not be interpreted as effects.
Step 5 of 8

Method and settings

Choose how the propensity score is used to make the groups comparable, then confirm the settings of that method.

Method

How should the groups be made comparable?
All three use the propensity scores of step 4. No method is best for every dataset: try one, look at the balance in step 7, and come back if needed. Report the method you used.

Nearest-neighbour matching pairs each treated participant with the control(s) whose propensity score is closest. Confirm each setting below.

Ratio

1:1 gives the closest matches. Higher ratios keep more of your control data (more statistical power) at the cost of somewhat worse matches. Ratios above 1:1 make most sense when controls greatly outnumber treated participants.

Replacement

Can the same control be matched to more than one treated participant?

Caliper

Maximum allowed distance between a treated participant and a matched control
A caliper prevents bad matches. Two conventions are in use: a width of 0.2 standard deviations of the score (Austin, 2011), or an absolute width on the probability scale, for example 0.01, meaning the matched pair may differ by at most one percentage point in their propensity (common in criminology evaluations). Neither is a rule. Smaller calipers improve balance and drop more treated participants.

Distance measure

Measure distances on

Exact matching

Require identical values on these categorical covariates (optional)
A treated participant is then matched only to controls with exactly the same value on every ticked variable (for example the same sex and the same offence type), and to the nearest of those. Treated participants with no such control stay unmatched, so tick only the few variables that must agree.

Matching order and random seed

Without replacement, whoever is matched first gets the best controls, so order changes the result slightly. "Largest first" gives priority to the treated participants who are hardest to match.
Used only when the order is random. Any run with the same file, settings, and seed produces exactly the same matches, so record it in your methods. Ties between equally distant controls are always broken by original row order, not randomly.

What does this mean?

These settings define the trade-off between match quality (how similar each pair is) and sample size (how many participants you keep). There is no single correct choice; the balance diagnostics in step 7 will show you what your choice achieved, and you can come back and adjust.

With subclassification and weighting nobody is dropped, so the trade-off is a different one: more subclasses, or weights that are not truncated, adjust more exactly but lean on fewer participants. The effective sample size in step 6 shows how much information is left.

Learn more
  • The algorithm is greedy nearest-neighbour matching: it processes treated participants one at a time and never revisits earlier decisions. Optimal matching, which minimises the total distance across all pairs, is not implemented here.
  • When a caliper is set, the width in standard deviations is converted to the distance scale using the standard deviation of the distance measure in the full analysis sample; the resulting value is reported in step 6.
  • With ratios above 1:1 and a caliper, a treated participant may receive fewer than the requested number of controls; they are kept if at least one control is found and the number of incomplete sets is reported.
  • Weights. Treated participants receive weight 1. Each control receives the sum, over the matched sets it belongs to, of 1 divided by the size of that set; control weights are then rescaled to sum to the number of unique matched controls (the convention used by the MatchIt package). In 1:1 matching without replacement all weights equal 1.
Step 6 of 8

Results

What does this mean?

The matched sample is the subset of your data that will be used for the outcome analysis. Every treated participant listed as unmatched had no eligible control: none inside the caliper, none with the same values under exact matching, or none left when matching without replacement. Dropping treated participants changes the question slightly: the result then applies to the kind of treated participants who could be matched.

Learn more
  • The match ID links each treated participant to its control(s). Keep it: paired analyses and cluster-robust standard errors use it.
  • The effective sample size of the control group shows how much information the weighted controls really carry. With replacement it can be much smaller than the number of unique controls.
  • Unmatched controls simply drop out; this is expected and does not bias the treated-group estimate.
Step 7 of 8

Balance diagnostics

Did matching make the treated and control groups similar on the covariates?

Balance criterion

Treat a covariate as balanced when the absolute standardised bias is below
The criterion changes only the labels and the verdict; the numbers themselves do not change. Report the criterion you used.
Denominator of the bias after matching
Both are legitimate readings of Rosenbaum and Rubin (1985). The before-matching bias is identical under both; the after-matching bias usually differs by a few tenths of a percent.

What does this mean?

The standardised bias (or standardised mean difference, SMD) compares the two groups on each covariate in standard-deviation units, so variables on different scales can be read side by side. Bias is the same quantity expressed in percent: a bias of 20% is an SMD of 0.20. A value of 0 means identical averages. The table also reports the significance tests that many published evaluations show alongside the bias (t-test for continuous variables, chi-square for categorical ones): before matching, most differences are usually significant; after matching, none should be. The Love plot shows each covariate before (hollow) and after (filled) matching; dots that move toward zero mean matching helped.

Learn more
  • Bias (%) = 100 × (mean in treated − mean in control) / √[(vartreated + varcontrol) / 2], following Rosenbaum and Rubin (1985). With matched-sample variances the variances after matching are those of the matched groups; with the cobalt convention they are those of the unmatched analysis sample. After matching, means and variances are weighted by the matching weights. SMD = bias / 100. The "% reduction" column is 100 × (1 − |bias after| / |bias before|).
  • For indicator variables the same formula is used, with proportions as means.
  • Significance tests after matching count each matched control once for every matched set it belongs to (frequency weighting). Tests depend on sample size, so a non-significant difference in a small matched sample is weaker evidence than a small bias; report both, and give the bias more weight.
  • The variance ratio (treated variance / control variance) is shown for continuous variables; values near 1 (roughly 0.5 to 2) indicate similar spread.
  • If balance is poor, you may return to step 5 (tighter caliper, logit distance, matching with replacement) or to step 3 (add interaction or squared terms as new columns in your file). Statistical tests of group differences after matching are not shown because they depend on sample size and are not recommended for assessing balance.
  • Good balance on the covariates you included says nothing about variables you did not measure. That limitation belongs in your discussion section.
Step 8 of 8

Export

Download the matched data and the methods text describing exactly what was done.

Complete session workbook

One Excel file with everything from this session: the matched data, all original rows with match columns, the matched sets, the propensity model, score summaries, the balance table, outcome results and sensitivity bounds (if run), the settings record, and the methods text. This is the file to archive with your study.

Matched dataset

Only the matched participants, with all original columns plus the new ones listed below.

Full dataset with match columns

Every original row, including unmatched and excluded participants, so you can document what was dropped.

Balance table

Before/after standardised mean differences and variance ratios for every covariate.

Outcome results

Rates, tests, effect sizes and sensitivity bounds from the optional outcome comparison (step 9).

Settings record

Every choice made in this session, as a small JSON file, so the analysis can be repeated exactly.

Columns added to the exported data

analysis_sample1 if the row had complete data on the treatment variable and all covariates and was used to estimate the propensity score; 0 otherwise.
treatment_indicator1 = treated, 0 = control, as defined in step 2.
propensity_scoreEstimated probability of treatment (blank for rows outside the analysis sample).
matched1 if the participant is part of the matched sample (with subclassification or weighting: everyone in the analysis sample).
match_idIdentifier shared by a treated participant and its matched control(s). With replacement, a control reused in several sets carries the ID of the first set it joined; the full assignment is in match_ids_all.
match_ids_allAll match IDs a control belongs to, separated by semicolons (only differs from match_id when matching with replacement).
matching_weightWeight to use in the outcome analysis: the matching, subclassification or propensity score weight of the method chosen in step 5 (0 for participants who are not used).
times_matchedHow many matched sets a control was used in.
subclassNumber of the propensity score subclass (only with subclassification).

Methods summary

Generated from the exact settings and results of this session. Edit freely; the references are listed at the end.

If you use this tool in your work, please cite it:

AcademiQuery. (2026). Propensity score matching tool (Version 2.0) [Computer software]. https://academiquery.com/tools/psm.html

What does this mean?

Matching prepares the data; it does not estimate the treatment effect. Analyse the outcome in the matched dataset with your usual software, using the matching weights and, ideally, the match ID for paired or cluster-robust standard errors. The methods summary gives readers everything needed to reproduce the matching step.

Step 9 of 9 (optional)

Compare outcomes

For binary outcomes such as rearrest or reincarceration within 1, 2, 3 years: rates in each group, a chi-square test, an effect size, and a sensitivity analysis for hidden bias.

Outcome variables

Tick one or more binary variables. Choose which value counts as the event (for example 1, yes, or rearrested). Participants with a missing value on an outcome are excluded from that outcome only, so the n can shrink across follow-up years.

in steps of 0.05

What does this mean?

Because the two groups are now balanced on the covariates, a difference in outcome rates can be read as the estimated effect of the treatment on the treated, subject to the usual caveat about unmeasured differences. The relative change tells you by how much the treated group's risk was lower (or higher) than the comparison group's. Cohen's d expresses the same difference in standard-deviation units (0.2 small, 0.5 medium, 0.8 large). The sensitivity analysis asks how strong an unmeasured variable would have to be before the result stops being significant.

Learn more
  • Chi-square is Pearson's test on the 2 × 2 table of group by outcome, with matched controls counted once per matched set (frequency weighting). Cohen's d = (pT − pC) / √[(SDT² + SDC²) / 2], with SD = √[p(1 − p)]. Relative change = (pT − pC) / pC.
  • Mantel-Haenszel bounds (Rosenbaum, 2002; Aakvik, 2001; Becker and Caliendo, 2007) treat the matched sample as a 2 × 2 table and ask: if an unmeasured variable changed the odds of being treated by a factor Γ, what is the largest p-value the test could take? Γ = 1 means no hidden bias. Two columns are given: Qmh+ for the case where hidden bias would make the effect look better than it is (overestimation), and Qmh− for underestimation. When the treated group has the lower rate, read the Qmh− column, and find the Γ at which its p-value first exceeds 0.05 (or 0.10): that is how strong a hidden confounder would have to be to explain the result away. Results that remain significant only up to Γ ≈ 1.1 to 1.2 are typical for criminological data and should be described as sensitive to hidden bias.
  • The bounds are computed on the whole matched sample as a single stratum. Results for other software may differ slightly if strata or different weights are used.
  • Rates across follow-up years can only rise if the same people are followed each year. When later years have fewer participants (because recent releases have not been followed that long), each year describes a different subgroup; say so when reporting.
The tool is provided as is, without warranty. You are responsible for checking your data, the settings and the results before you rely on them or publish them. The tool does not replace statistical advice. See the Terms of use in the menu.