View source: R/check_heaping.R
check_heaping_bachi | R Documentation |
Bachi's index involves applying the Whipple method repeatedly to determine the extent of preference for each final digit. Similarly to Myers', it equals the sum of the positive deviations from 10 percent. It has a theoretical range from 0 to 90, and 10 is the expected value for each digit. There are two implementations.
check_heaping_bachi(
Value,
Age,
ageMin = 23,
ageMax = NULL,
method = "orig",
details = FALSE,
OAG = TRUE
)
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 |
the minimum age used for estimation, default |
ageMax |
the maximum age used for estimation, default |
method |
either |
details |
logical. Should a list of output be given |
OAG |
logical. Is the highest age group open? |
ageMax
is an inclusive upper bound, treated as interval. If you want ages
23 to 77, then give ageMin = 23
and ageMax = 77
. The ageMin
is respected strictly, whereas ageMax
is calculated flexibly- if you specify something too high then it is reduced and we warn accordingly, and if it's missing then we pick something reasonable. You can see the age ranges actually used by specifying details = TRUE
.
The value of the index.
PASDemoTools \insertRefbachi1951tendencyDemoTools \insertRefshryock1973methodsDemoTools
check_heaping_bachi(pop1m_pasex, Age = 0:99,
ageMin = 23, ageMax = 77, method = "orig", OAG =FALSE)
check_heaping_bachi(pop1m_ind, Age = 0:100,
ageMin = 23, ageMax = 77, method = "orig")
# default simpler
check_heaping_bachi(pop1m_pasex, Age = 0:99,
ageMin = 23, ageMax = 77, method = "pasex", OAG = FALSE)
# linear population, should give 0 for pasex
check_heaping_bachi(seq(100000,1000,by=-1000),Age = 0:99,
ageMin = 23, ageMax = 77, method = "pasex", OAG = FALSE)
# fully concentrated, should give 90
pop_concetrated <- rep(c(100,rep(0,9)),10)
check_heaping_bachi(pop_concetrated, Age = 0:99,
ageMin = 23, ageMax = 77, method = "pasex")
check_heaping_bachi(pop_concetrated, Age = 0:99,
ageMin = 23, ageMax = 77, method = "orig")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.