This implementation is based largely on the sparse verbal description given in Coale and Li (1991): calculate a two-stage 5-term moving average as a reference pattern, then take ratios with respect to this. Ratios for a given terminal digit can then be averaged to produce an index. This procedure was used in that paper for ages 65-100 for mortality rates. It is probably better suited to rates than counts, but that is not a hard rule.
check_heaping_coale_li( Value, Age, ageMin = 60, ageMax = max(Age), terms = 5, digit = 0 )
Value | numeric. A vector of demographic counts by single age. |
---|---|
Age | numeric. A vector of ages corresponding to the lower integer bound of the counts. |
ageMin | integer. The lowest age included in calculations. Default 25. |
ageMax | integer. The upper age bound used for calculations. Default 65. |
terms | integer. Length of the (centered) moving average be. Default 5. |
digit | integer. Any digit 0-9. Default 0. |
The value of the index.
digit
could also be a vector of digits, but the more digits one includes (excepting 0 and 5) the closer the index will get to 1.
It is therefore recommended for single digits, or else c(0,5)
.
ageMax
is an inclusive upper bound, treated as interval.
If you want ages 20 to 89, then give ageMin = 20
and ageMax = 89
, not 90. By default all available ages greater than or equal to ageMin
are used.
Coale AJ, Li S (1991). “The effect of age misreporting in China on the calculation of mortality rates at very high ages.” Demography, 28(2), 293--301.
Age <- 0:99 check_heaping_coale_li(pop1m_pasex, Age, 65, 95, 5, 0) # 3.7#> [1] 3.707479check_heaping_coale_li(pop1m_pasex, Age, 65, 95, 5, 5) # 3.5 almost just as high#> [1] 3.470823