ESTHER-ineq
Epidemiological Statistics Toolkit for Health Inequality Estimation and Reporting in Python
ESTHER-ineq (esther-ineq) is a scientific Python library uniting complex-survey health econometrics (World Bank Analyzing Health Equity, Stata conindex / lorenz / oaxaca_rif, R convey / rineq) and epidemiological health inequality surveillance & reporting (WHO Health Inequality Monitor healthequal / HEAT, Pelotas ICEH ICEHmeasures / equiplot, UKHSA PHEindicatormethods, Moreno-Betancur GLMs, and STROBE-Equity 2025).
Key Capabilities (v0.1.0)
- Dual First-Class Data Containers (
SurveyHealthData&GroupedHealthData):- Native support for
pandas.DataFrame,polars.DataFrame, and optionalsvy.Sample(samplics-org/svy) objects. - Full complex multistage survey design support: probability weights (
weights), stratification (strata), primary sampling units (psu), finite population correction (fpc), lonely-PSU handling, survey replicate weights (BRR,Fay,JK1,JKn,Bootstrap), and unconditional domain/subpopulation comparisons (by=...).
- Native support for
- Exact Influence-Function (
IF/RIF) Variance Kernel:- Default
vce="if"accounts jointly for outcome variance, mean $\hat{\mu}_h$ denominator variance, and fractional rank $\hat{R}_i$ uncertainty in $O(N \log N)$ time, alongsidevce="convenient"andvce="newey"modes for 1-to-1 Stataconindexreplication.
- Default
- Complete Concentration & Classical Inequality Suite:
- Standard (
CI), Generalized (GC/ACI), Modified (MC), Wagstaff (W), Erreygers (E), Extended (v), and Symmetric (beta) concentration indices with tie-exact interval integration + omnibus subgroup Wald $F$-tests. - Classical
Gini,S-Gini,Atkinson(+ Equally Distributed EquivalentEDE),Generalized Entropy(MLD,Theil, Between/Within subgroup decomposition),Palma, andS80/S20.
- Standard (
- All 21 WHO Health Inequality Monitor (
healthequal/ HEAT) Summary Measures:- Simple (
D,R), Ordered (ACI,RCI,SII,RII), Non-ordered (BGV,BGSD,COV,MDMW,MDMU,MDBW,MDBU,MDRW,MDRU,IDISW,IDISU,TI,MLD), and Population Impact (PAR,PAF) on both disaggregated tables and complex surveys.
- Simple (
- Modern Epidemiological
SII&RIIEngine:- Survey-weighted Logistic/Probit G-computation marginal standardization (
method="logit_marginal"), Moreno-Betancur Identity-link + Modified Poisson (method="moreno_betancur"), and WLS/Monte Carlo on surveillance tables, with age/stratum-specific ridits.
- Survey-weighted Logistic/Probit G-computation marginal standardization (
- Epidemiological & Need Standardization (
DSR,SMR,ISR, and Horizontal InequityHI):- Directly and indirectly standardized rates with exact Dobson / Byar Poisson-Gamma CIs and built-in WHO (2000–2025), Segi (1960), and European (2013) standard populations.
- Gravelle-consistent linear and nonlinear indirect need standardization (
HI) with PSU-level Rao–Wu–Yue survey bootstrap SEs.
- Regression & Counterfactual Decompositions:
- Wagstaff, van Doorslaer & Watanabe (2003) linear & GLM (
AME/MEM) decomposition with automatic reference-invariant dummy grouping for categorical factorsC(...). - Bivariate
RIF-I-OLS(Heckley, Gerdtham & Kjellsson, 2016) andRIF-Oaxaca(Ríos-Ávila, 2020, including IPW propensity reweighting).
- Wagstaff, van Doorslaer & Watanabe (2003) linear & GLM (
- Editorial Visualizations & Trilingual
STROBE-EquityReporting (en,es,pt):- Pelotas
equiplot(with automatic top vs. bottom inequality pattern diagnostics), Concentration/Lorenz curves with simultaneous confidence bands, SII/RII Ridit bubble gradients, Decomposition forest plots, and Spiegelhalter overdispersedfunnel_plots (matplotlib+ optionalplotly). - Direct export to
DataFrame,Markdown,LaTeX(booktabs),HTML,Excel (.xlsx), andWord (.docx)with automated STROBE-Equity (2025) methodological notes.
- Pelotas
Installation
pip install esther-ineq
# With optional Polars, Plotly, and Office exporters:
pip install "esther-ineq[all]"
For local editable development:
pip install -e .
Quick Start
import esther_ineq as ei
# 1. Load built-in DHS/ENDES-style complex survey dataset
df = ei.datasets.load_survey_mch()
svy = ei.SurveyHealthData(
data=df,
weights="sample_weight",
strata="stratum_id",
psu="cluster_id",
)
# 2. Erreygers concentration index across urban vs. rural domains + Wald F-test
res_ci = svy.concentration_index(
outcome="stunting",
rank="wealth_score",
method="erreygers",
by="area",
favorable=False,
)
print(res_ci.summary()) # Default English; pass lang="es" or lang="pt" if needed
# 3. Epidemiological SII & RII + LaTeX booktabs table & STROBE-Equity note
res_sii = svy.sii_rii(
outcome="full_immunization",
rank="wealth_quintile",
favorable=True,
scale=100.0,
)
print(res_sii.to_latex())
# 4. Reference-invariant Wagstaff decomposition
decomp = svy.decompose_wagstaff(
formula="stunting ~ C(mother_edu) + C(area) + improved_sanitation + child_age_mo",
rank="wealth_score",
method="erreygers",
bootstrap_reps=200,
)
fig, ax = decomp.plot()
# 5. Pelotas equiplot directly from survey microdata (no manual collapse/reshape needed)
fig_eq, ax_eq = svy.equiplot(
outcome="full_immunization",
subgroup="wealth_quintile",
by="region",
scale=100.0,
diagnose_pattern=True,
sort_by="gap",
)
# Or from a Stata-style wide subgroup table:
# ei.equiplot(df_wide, columns=["Q1", "Q2", "Q3", "Q4", "Q5"], by="dpto", outcome="cloro")
Documentation
See the docs/ directory for:
- User guide and overview
- Mathematical methodology and variance formulas
- R (CRAN), Python, and Stata ecosystem benchmark
- API reference
Methodological Credits & References
- ICEH Pelotas Equiplot & Inequality Patterns: International Center for Equity in Health (ICEH), Federal University of Pelotas (
equidade.org/equiplot; Barros & Victora). - WHO Health Inequality Monitor: Schlotheuber & Hosseinpoor (2022), International Journal of Environmental Research and Public Health (
healthequal/ HEAT). - Rank-Dependent Concentration Indices & Decompositions: O'Donnell, van Doorslaer, Wagstaff & Lindelow (2008); O'Donnell, O'Neill, Van Ourti & Walsh (2016,
conindex); Heckley, Gerdtham & Kjellsson (2016); Ríos-Ávila (2020,oaxaca_rif). - Epidemiological SII, RII, and Reporting: Moreno-Betancur et al. (2015); Welch et al. (2025,
STROBE-Equity).
Citation
If you use ESTHER-ineq in academic research or public health surveillance reports, please cite:
@software{hernandez_vasquez_esther_ineq_2026,
author = {Hern{\'a}ndez-V{\'a}squez, Akram},
title = {{ESTHER-ineq: Epidemiological Statistics Toolkit for Health Inequality Estimation and Reporting in Python}},
year = {2026},
version = {0.1.0},
url = {https://github.com/ahernandezv/ESTHER-ineq}
}
Acknowledgments
This work was supported in part by complimentary access to Google Antigravity and Gemini 4 Argon to accelerate scientific workflows.
License
Distributed under the GNU General Public License v3.0 or later (GPL-3.0-or-later). See LICENSE for details.
Metadata
Release files for esther-ineq 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| esther_ineq-0.1.0.tar.gz | 102.9 kB | With provenance | Details for esther_ineq-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| esther_ineq-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for esther_ineq-0.1.0-py3-none-any.whl |
Total release size: 210.9 kB
Release files / esther_ineq-0.1.0.tar.gz
| Download URL | esther_ineq-0.1.0.tar.gz |
|---|---|
| Size | 102.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d5eca3e70582a3de0eb17a226f5af885fd7a0efcf538a1e08e4fa9b3d7da01f
|
|
BLAKE2b-256 checksum How to use checksums |
9d1fd077d378b56d9e83441fe2489c444050897fbe0233a0b476dbe3a0429d0a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / esther_ineq-0.1.0-py3-none-any.whl
| Download URL | esther_ineq-0.1.0-py3-none-any.whl |
|---|---|
| Size | 107.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec855ba94f02b97051f41435d9d74623315fce09666f8a3083adbac1a22c560b
|
|
BLAKE2b-256 checksum How to use checksums |
71fbc4c7140fb928d8cbfb715c4730c997af4c93ae3f14b0b7094308e885511b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for esther-ineq 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for esther_ineq-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.