NEWS


inequality 0.2.1

Patch release. One fix, to a side effect rather than to any returned value.

iq_sample_data() called set.seed(42L) and did not restore the previous state, so calling it reseeded the caller's random stream. Anyone who ran iq_sample_data() to get a demonstration data frame found every subsequent random draw in their session silently reset to a fixed sequence, which quietly breaks reproducibility for the analysis around it. The seed now applies for the duration of the call only and .Random.seed is restored on exit.

The generated data is unchanged: a given type still returns exactly the same values, and now does so regardless of the caller's own seed. No inequality measure returns a different number as a result of this release.

inequality 0.2.0 (2026-09-08)

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(), 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_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

New features (audit follow-up)

Acknowledgements

Thanks to Frank Cowell and Emmanuel Flachaire for the careful read and the two-line list of gaps.

inequality 0.1.0 (2026-04-20)

Inequality indices

Distribution and decomposition

Poverty

Fiscal

Utilities