ageSexAccuracy: Calculate an age-sex accuracy index

View source: R/AGESEX.R

ageSexAccuracyR Documentation

Calculate an age-sex accuracy index

Description

This index is a composite consisting in the sum of thrice the sex ratio index plus the age ratio index for males and females. This function is therefore a wrapper to ageRatioScore() and sexRatioScore().

Usage

ageSexAccuracy(
  Males,
  Females,
  Age,
  ageMin = 0,
  ageMax = max(Age),
  method = "UN",
  adjust = TRUE,
  OAG = TRUE
)

Arguments

Males

numeric. A vector of demographic counts in 5-year age groups for males.

Females

numeric. A vector of demographic counts in 5-year age groups for females.

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 max(Age).

method

character. Either "UN" (default), "Zelnick", or "Ramachandran",or "das gupta".

adjust

logical. Whether or not to adjust the measure when population size is under one million. Default TRUE.

OAG

logical. Whether or not the top age group is open. Default TRUE.

Details

Age groups must be of equal intervals. Five year age groups are assumed. If the final element of Males and Females is the open age group, then either make sure ageMax is lower than it, or leave OAG as TRUE so that it is properly removed for calculations. The method argument is passed to ageRatioScore(), where it determines weightings of numerators and denominators, except in the case of Das Gupta, where it's a different method entirely (see ageSexAccuracyDasGupta().

Value

The value of the index.

References

\insertRef

accuracyun1952DemoTools \insertRefdasgupta1955DemoTools \insertRefPASDemoTools

Examples

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)
ageSexAccuracy(Males, Females, Age)    # 14.3, matches PAS
ageSexAccuracy(Males, Females, Age, ageMax = 75)
ageSexAccuracy(Males, Females, Age, ageMax = 75, adjust = FALSE)
ageSexAccuracy(Males, Females, Age, method = "Zelnick")
ageSexAccuracy(Males, Females, Age, method = "Ramachandran")
# Das Gupta not a comparable magnitude, FYI.
ageSexAccuracy(Males, Females, Age, method = "Das Gupta")

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