ageRatioScore | R Documentation |
A single ratio is defined as the 100 times twice the size of an age group to its neighboring two age groups. Under uniformity these would all be 100. The average absolute deviation from 100 defines this index. This comes from the PAS spreadsheet called AGESEX
ageRatioScore(
Value,
Age,
ageMin = 0,
ageMax = max(Age),
method = "UN",
OAG = TRUE
)
Value |
numeric. A vector of demographic counts in 5-year age groups. |
Age |
numeric. A vector of ages corresponding to the lower integer bound of the counts. |
ageMin |
integer. The lowest age included in calculations. Default 0. |
ageMax |
integer. The upper age bound used for calculations. Default |
method |
character. Either |
OAG |
logical. Whether or not the top age group is open. Default |
Age groups must be of equal intervals. Five year age groups are assumed.
It is also assumed that the final age group is open, unless ageMax < max(Age)
.
Setting OAG = FALSE
will override this and potentially include max(Age)
in calculations.
The method argument determines the weighting of numerators and denominators, where the UN method puts
twice the numerator over the sum of the adjacent ages classes, Zelnik does thrice the
numerator over the sum of the whole range from the next lowest to the next highest age, and
Ramachandran does four times the numerator over the same sum, but with the central age
double-counted in the numerator.
The value of the index.
accuracyun1952DemoTools \insertReframachandran1967DemoTools \insertRefPASDemoTools
# data from PAS spreadsheet AGESEX.xlsx
Males <- c(4677000,4135000,3825000,3647000,3247000,2802000,2409000,2212000,
1786000,1505000,1390000,984000,745000,537000,346000,335000)
Females <- c(4544000,4042000,3735000,3647000,3309000,2793000,2353000,2112000,
1691000,1409000,1241000,887000,697000,525000,348000,366000)
Age <- seq(0, 75, by = 5)
ageRatioScore(Males, Age, ageMax = 75) # 3.9, matches PAS
ageRatioScore(Females, Age, ageMax = 75) # 3.66 matches PAS
ageRatioScore(Females, Age, ageMax = 75, method = "Ramachandran") # 1.8
ageRatioScore(Females, Age, ageMax = 75, method = "Zelnick") # 2.4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.