Skip to content

inequality

0.2.0Package record

Inequality Measurement, Decomposition, and Poverty Analysis

0packages depend
2.2Kdownloads / year
89.6%test coverage
13/13flavors OK

Overview

About

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.

Changes in 0.2.0

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() and iq_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 returns NA shares with a warning.
  • iq_palma(), iq_hoover(), and iq_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() and iq_polarisation() now warn rather than abort when the relevant denominator is non-positive (returning NA).
  • The standard Gini now returns NA (with a warning) when the population mean is non-positive. Previously the function returned 0 when mu == 0, which conflated "perfect equality" with "undefined". With negatives = "keep" set, the user is pointed at normalised = TRUE for the Raffinetti et al. (2017) bounded variant.
  • The Watts poverty index drops observations with x = 0 from the Watts sum (since log(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 a normalised flag implementing the Raffinetti, Siletti and Vernizzi (2017) Gini variant, which is bounded in [-1, 1] for distributions containing negative values.
  • iq_compare() gains a negatives argument. With negatives = "keep" it permits zero or negative input and returns NA for 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 a correction = "wagstaff" option for the Wagstaff (2005) normalised concentration index, alongside the existing Erreygers (2009) correction.
  • ?iq_theil now documents the convention difference vs the legacy ineq package (ineq::Theil(x, parameter = 0) corresponds to GE(1) / Theil T here, not to GE(0) / Theil L).
  • New tests/testthat/test-axioms.R locks 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.R cross-checks Gini, Theil, and Atkinson values against the legacy ineq package on a fixed seed. Skipped when ineq is 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

CRAN checks
13OK
Slowest check: 1.3 min · r-oldrel-windows-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK7 OK2026-04-21
Advisories

none known

Documentation

In release 0.2.0
README· In the repository, left out of the releaseVignettesNoNEWSYes · 100% structured · mentions 0.2.0Citation fileNoWebsiteYes · pkgdown
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

2.2K
CRAN downloads in the past year
Rank #13,762 · ~6/day · ~179/mo
Daily download trend is not available in this view yet.
29930 days
85490 days
2.2K1 year
Compare downloads with other packages →
Also on46 r2u3 autocran

Repository

0Stars
0Forks
0Open issues
0Open PRs
0Releases
Last activity 2026-09-19 · Default branch at 0.2.1, ahead of CRAN 0.2.0 (checked 2026-10-21)
Responsiveness
not measured
PracticesBeta

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.

Continuous integration (1)
GitHub Actions
Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-09-19 · The repository has a site deploy workflow

pkgdown site last built 2026-09-19

CRAN release process (2)
cran-comments.mdCRAN-SUBMISSION
For agents and models (1)
llms.txt
How this is detected·Detection ruleset v4 (2026-10-20)

Dependencies

Declared dependencies
3 external dependencies (excludes base and recommended)

Installing inequality adds 1 package (1 with compiled code, 629 KB of source tarballs). Heaviest: cli 629 KB.

Depends (1)
R >= 4.1.0
Imports (4)
cligrDevicesgraphicsstats
LinkingTo (0)
none
Suggests (2)
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.0 (2026)
Releases (2)

Pick two releases to compare their code metrics.

  • 0.2.0Latest
    record
    2026-09-08 · current release · diff ↗
  • R
    R 4.6.0 released · 2026-04-24
  • 0.1.0
    record
    2026-04-20
  • R
    R 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")
Coverdale, C. (2026). inequality: Inequality Measurement, Decomposition, and Poverty Analysis (Version 0.2.0) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for inequality version 0.2.0 [Data set]. HJJB, LLC. Data release v2026-10-25. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy