Inequality Measurement, Decomposition, and Poverty Analysis
Overview
Tools for measuring income and wealth inequality. Computes the Gini coefficient with bootstrap or asymptotic confidence intervals following Davidson (2009) doi:10.1016/j.jeconom.2008.11.004, the extended S-Gini family, Theil T and L indices (generalised entropy family), the Atkinson index, the Kolm absolute inequality index, Palma ratio, Hoover index, percentile ratios, and Lorenz curves. Supports between-within group decomposition following Bourguignon (1979) doi:10.2307/1914138, income share tabulation, concentration indices for health inequality with Erreygers (2009) correction, Kakwani tax progressivity and Reynolds-Smolensky redistribution indices, Foster-Greer-Thorbecke poverty measures including the Sen index, growth incidence curves following Ravallion and Chen (2003) doi:10.1016/S0165-1765(02)00205-7, and Wolfson polarisation. All functions accept optional survey weights and work with data from any source.
This release responds to feedback from Frank Cowell and Emmanuel Flachaire
(personal communication, 1 May 2026) on the v0.1.0 release. Two gaps were
flagged: confidence intervals were available only for the Gini, and the
package rejected non-positive values for the Gini and the top shares. A
follow-up internal audit produced several smaller fixes that ship together.
Confidence intervals on every inequality measure
Bootstrap confidence intervals are now available on every inequality
function via ci = TRUE. Each function gains ci, R, and level
arguments matching the existing Gini API. Results are returned in
ci_lower, ci_upper, and se fields on the output object and shown by
the print method.
Functions extended: iq_theil(), iq_atkinson(), iq_sgini(),
Show all changes in 0.2.0Hide the rest of the changes in 0.2.0
iq_palma(), iq_hoover(), iq_kolm(), iq_percentile_ratio(),
iq_polarisation(), iq_shares(), iq_concentration(), iq_kakwani(),
and iq_poverty().
The bootstrap uses probability-proportional resampling, so survey weights
flow through to the variance, not just the point estimate.
iq_compare() runs one bootstrap loop, propagates CIs to every row
When ci = TRUE, iq_compare() now runs a single resample loop and
attaches ci_lower and ci_upper columns to every row of the table. The
old gini_ci field is removed. The table now also covers S-Gini,
Kolm, and Wolfson (12 measures, up from 9).
Negative values are now supported via negatives = "keep"
Functions that are mathematically defined for distributions containing
negative values now accept negatives = c("error", "keep"), with
"error" as the default for back-compatibility. With negatives = "keep":
iq_gini()andiq_sgini()permit negatives; the index is still computed by the standard formula but is no longer bounded in [0, 1]. The print method emits a note when the input contains negatives.iq_shares()permits negatives; segment shares may fall outside [0, 1] and a warning is issued. If total income is non-positive, the function returnsNAshares with a warning.iq_palma(),iq_hoover(), andiq_polarisation()similarly accept negatives.
iq_kolm() already worked for negative values and is unchanged.
iq_atkinson() and iq_theil() continue to require strictly positive
values: they involve log(x) or x^(1 - epsilon) for which the formula
is mathematically undefined at zero or below. The error message now
documents this explicitly.
Bug fixes
iq_kakwani()no longer takes the absolute value of post-tax income before computing the post-tax Gini. Households whose post-tax income is negative are now reflected honestly in the Reynolds-Smolensky index.iq_palma()andiq_polarisation()now warn rather than abort when the relevant denominator is non-positive (returningNA).- The standard Gini now returns
NA(with a warning) when the population mean is non-positive. Previously the function returned0whenmu == 0, which conflated "perfect equality" with "undefined". Withnegatives = "keep"set, the user is pointed atnormalised = TRUEfor the Raffinetti et al. (2017) bounded variant. - The Watts poverty index drops observations with
x = 0from the Watts sum (sincelog(line / 0)diverges) and emits a one-time warning. FGT measures and the Sen index continue to include all poor observations. iq_percentile_ratio()now warns when the lower percentile is negative, since the resulting ratio sign-flips and has no inequality interpretation.- The error message for measures that require strictly positive input (Theil, Atkinson, decompose, growth_incidence) no longer suggests setting
negatives = "keep", which those wrappers do not expose. Instead the message points the user at measures that admit zero or negative support.
New features (audit follow-up)
iq_gini()gains anormalisedflag implementing the Raffinetti, Siletti and Vernizzi (2017) Gini variant, which is bounded in [-1, 1] for distributions containing negative values.iq_compare()gains anegativesargument. Withnegatives = "keep"it permits zero or negative input and returnsNAfor the Theil and Atkinson rows (which are mathematically undefined for non-positive values), while still computing Gini, S-Gini, Kolm, Wolfson, Hoover, Palma and percentile-ratio rows.iq_concentration()gains acorrection = "wagstaff"option for the Wagstaff (2005) normalised concentration index, alongside the existing Erreygers (2009) correction.?iq_theilnow documents the convention difference vs the legacyineqpackage (ineq::Theil(x, parameter = 0)corresponds to GE(1) / Theil T here, not to GE(0) / Theil L).- New
tests/testthat/test-axioms.Rlocks in scale invariance, Kolm translation invariance, Pigou-Dalton transfer principle, anonymity, parameter monotonicity, decomposition exactness, the Erreygers and Wagstaff bounds, and bootstrap nominal coverage. - New
tests/testthat/test-cross-package.Rcross-checks Gini, Theil, and Atkinson values against the legacyineqpackage on a fixed seed. Skipped whenineqis not installed and on CRAN.
Acknowledgements
Thanks to Frank Cowell and Emmanuel Flachaire for the careful read and
the two-line list of gaps.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-04-21
Documentation
- Help pages
- 19 (1 internal)includes a package overview page
- Examples that run
- 100%18 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 68%
Downloads
Repository
7 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/charlescoverdale/inequality on 2026-10-21.
GitHub Pages site last deployed 2026-09-19 · The repository has a site deploy workflow
pkgdown site last built 2026-09-19
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 0.2.0Latest
- RR 4.6.0 released · 2026-04-24
- 0.1.02026-04-20
- RR 4.5.0 released · 2025-04-11
Package metadata
- First published
- 2026-04-20
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.1.0
- Download size
- 65 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("inequality")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.