Package: ebal 0.3-0

ebal: Entropy Reweighting to Create Balanced Samples

Implements entropy balancing, a data preprocessing procedure described in Hainmueller (2012, <doi:10.1093/pan/mpr025>) that allows users to reweight a dataset such that the covariate distributions in the reweighted data satisfy a set of user-specified moment conditions. Useful for creating balanced samples in observational studies with a binary treatment where the control group is reweighted to match the covariate moments of the treatment group, and for reweighting a survey sample to known characteristics from a target population.

Authors:Jens Hainmueller [aut, cre], Apoorva Lal [aut]

ebal_0.3-0.tar.gz
ebal_0.3-0.zip(r-4.7)ebal_0.3-0.zip(r-4.6)ebal_0.3-0.zip(r-4.5)
ebal_0.3-0.tgz(r-4.6-any)ebal_0.3-0.tgz(r-4.5-any)
ebal_0.3-0.tar.gz(r-4.7-any)ebal_0.3-0.tar.gz(r-4.6-any)
ebal_0.3-0.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
ebal/json (API)

# Install 'ebal' in R:
install.packages('ebal', repos = c('https://j-hai.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/j-hai/ebal/issues

On CRAN:

Conda:

7.40 score 1 stars 2 packages 154 scripts 6.1k downloads 9 exports 0 dependencies

Last updated from:fc85de5757. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK128
source / vignettesOK181
linux-release-x86_64OK128
macos-release-arm64OK88
macos-oldrel-arm64OK77
windows-develOK93
windows-releaseOK72
windows-oldrelOK72
wasm-releaseOK103

Exports:balance_tablebaltest.collectdiagnosticsebebalanceebalance.trimgetsquaresline.searchermatrixmaker

Dependencies:

Estimands: ATT, ATE, ATC
A toy panel | Three fits | Where the weight goes | Diagnostics | Plots | Choosing an estimand

Last update: 2026-05-11
Started: 2026-05-05

Outcome models with ebalance weights
A simulated example | Fit | Weighted lm() with robust SEs | Adding regression adjustment (doubly-robust) | Survey-style inference | Trimming if weights blow up | Choice of estimand for inference

Last update: 2026-05-11
Started: 2026-05-05

Quickstart: entropy balancing with ebal
What is entropy balancing? | A minimal example | Fit | Tidy output | Plotting | Using the weights downstream | Two solver methods | See also | References

Last update: 2026-05-11
Started: 2026-05-05

Readme and manuals

Help Manual

Help pageTopics
Per-covariate balance table for an entropy-balancing fitbalance_table
Collect Covariate Balance Statisticsbaltest.collect
"Is my fit okay?" diagnostic check for an entropy-balancing fitdiagnostics print.ebalance.diagnostics
Function for Entropy Balancingeb
Entropy balancingebalance
Methods for ebalance and ebalance.trim objectsplot.ebalance plot.ebalance.trim print.ebalance print.ebalance.trim print.summary.ebalance print.summary.ebalance.trim summary.ebalance summary.ebalance.trim weights.ebalance weights.ebalance.trim
Trimming of Weights for Entropy Balancingebalance.trim
Generate Matrix of Squared Termsgetsquares
Optimal step length search for entropy balancing algorithmline.searcher
Generate Matrix of One-way Interactions and Squared Termsmatrixmaker