View source: R/heaping_indices.R
| bachi | R Documentation |
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.
bachi(x, ageMin = 23, ageMax = 77, weight = NULL)
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. |
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
A single numeric value representing Bachi's index.
Matthias Templ
Bachi, R. (1951). The tendency to round off age returns: measurement and correction. Bulletin of the International Statistical Institute, 33(4), 195-222.
myers for Myers' index,
whipple for Whipple's index.
Other heaping indices:
coale_li(),
heaping_indices(),
jdanov(),
kannisto(),
myers(),
noumbissi(),
spoorenberg(),
whipple()
# 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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.