bachi: Bachi's Index of Age Heaping

View source: R/heaping_indices.R

bachiR Documentation

Bachi's Index of Age Heaping

Description

Bachi's index involves applying the Whipple method repeatedly to determine the extent of preference for each terminal digit (0-9). It equals the sum of positive deviations from 10 percent.

Usage

bachi(x, ageMin = 23, ageMax = 77, weight = NULL)

Arguments

x

numeric vector of individual ages.

ageMin

minimum age to include (default 23).

ageMax

maximum age to include (default 77, adjusted to fit decades).

weight

optional numeric vector of sampling weights.

Details

Calculate Bachi's index to measure digit preference in age data.

The theoretical range is 0 to 90:

  • 0: no digit preference (each digit represents 10

  • 90: maximum heaping (all ages end in same digit)

For populations with no age heaping, each digit should appear in approximately 10

Value

A single numeric value representing Bachi's index.

Author(s)

Matthias Templ

References

Bachi, R. (1951). The tendency to round off age returns: measurement and correction. Bulletin of the International Statistical Institute, 33(4), 195-222.

See Also

myers for Myers' index, whipple for Whipple's index.

Other heaping indices: coale_li(), heaping_indices(), jdanov(), kannisto(), myers(), noumbissi(), spoorenberg(), whipple()

Examples

# No heaping
set.seed(42)
age_uniform <- sample(23:77, 10000, replace = TRUE)
bachi(age_uniform)  # Should be close to 0

# Strong heaping on 0 and 5
age_heaped <- sample(seq(25, 75, by = 5), 5000, replace = TRUE)
bachi(age_heaped)  # Should be high


heaping documentation built on Feb. 10, 2026, 1:08 a.m.