check_heaping_myers: Calculate Myer's blended index of age heaping

View source: R/check_heaping.R

check_heaping_myersR Documentation

Calculate Myer's blended index of age heaping

Description

Implementation following the PASEX spreadsheet SINGAGE. Myers' measures preferences for each of the ten possible digits as a blended index. It is based on the principle that in the absence of age heaping, the aggregate population of each age ending in one of the digits 0 to 9 should represent 10 percent of the total population.

Usage

check_heaping_myers(
  Value,
  Age,
  ageMin = 23,
  ageMax = 82,
  details = FALSE,
  method = "orig"
)

Arguments

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 82.

details

logical. Default FALSE. If TRUE, then a list is returned with some relevant parameters.

method

either "orig" or "pasex"

Details

ageMax is an inclusive upper bound, treated as interval. If you want ages 23 to 82, then give ageMin = 23 and ageMax = 82, not 83 ageMax may be internally rounded down if necessary so that ageMax - ageMin + 1 is evenly divisible by 10. If in doubt, specify details = TRUE, and you can check which ageMax is actually used internally.

Value

The value of the index.

References

\insertRef

myers1954accuracyDemoTools \insertRefspoorenberg2007qualityDemoTools \insertRefPASDemoTools

Examples

Age <- 0:99
check_heaping_myers(pop1m_pasex, Age, 10, 89)
check_heaping_myers(pop1m_pasex, Age, 10, 89, method = "pasex") * 2
# pasex 10-89. result: ___ from spreadsheet
check_heaping_myers(pop1m_pasex, Age, 23, 82)
check_heaping_bachi(pop1m_pasex, Age, 23, 82, method = "orig")
check_heaping_bachi(pop1m_pasex, Age, 23, 82, method = "pasex")

timriffe/DemoTools documentation built on Jan. 28, 2024, 5:13 a.m.