Skip to content
StatsOtter A workspace for causal thinking
Method library WORKFLOW / 017
Research workflow/4 steps

Covariate balance for matching & weighting (cobalt)

Source cobalt — Noah Greifer
01
The method workspace

Follow the analysis.

Select a node to explore the method

Method mapInput → 4 steps → output
START WITHInput data
ARRIVE ATResults
Read step 01
Inside the methodReasoning, equations & implementation
Step 1 of 4
01
Data prep

Treatment W + covariates X

Data preparation — shapes the raw inputs into what the estimator expects.

What happens here

Binary treatment plus the covariates to balance (Lalonde: age, educ, race, re74, re75).

Reads fromNot specified Feeds into#2
Key code
data("lalonde", package = "cobalt")
Discussion on this step (0)
StatsOtterDiscussion starter · Editorial note

Before using this step, make its assumptions and its output explicit. A useful peer note explains what you would check, what could go wrong, or what would change your interpretation.

Questions to explore
  1. Which assumption matters most here, and what evidence could challenge it?
  2. What would you check before passing this output to the next step?

Peer discussion

  • Bring your experience, a question, or a different perspective.
02
Data contract

Inputs & data

A binary treatment and the covariates you'll adjust for (e.g. the Lalonde job-training data).

Show data format & exampleHide example

Format — one row per unit: treatment W ∈ {0,1} and covariates X.

  W   age  educ   race   re74    re75
  1    37    11   black     0       0
  0    30    12   white  4100    3800
03
Read the evidence

Results & interpretation

4 figures Workflow discussion 2
01FigureA Love plot of |standardized mean difference| per covariate, adjusted vs unadjusted, against the 0.1 threshold.
02FigureDistributional balance for a covariate before vs after adjustment.
03FigureCovariate balance across the sample, adjusted vs unadjusted.
04FigureOverlap / propensity distribution between treatment groups.

Figures reproduced from cobalt — Noah Greifer — unofficial community showcase; all credit to the original authors.

Context & interpretation

From the cobalt vignette (Lalonde). Estimate weights/matches, then check that adjustment actually balanced the covariates. Unofficial summary.

Peer notes

Discuss the workflow (2)

  • 3

    A causal estimate from observational data without a Love plot is a vibe, not evidence. cobalt makes the balance check trivial.

    3

    100%. I put love.plot() in every appendix now. Reviewers love it.

  • 4

    Works with MatchIt, WeightIt, raw weights… one balance API for everything. Underrated.

IN THE MARGINS

Peer discussion