sexRatioScore: Calculate the PAS sex ratio score

View source: R/AGESEX.R

sexRatioScoreR Documentation

Calculate the PAS sex ratio score

Description

A single ratio is defined as males per 100 females. Taking the first difference of the ratios over age would give 0s if the ratio were constant. The average absolute difference over age defines the index. This comes from the PAS spreadsheet called AGESEX.

Usage

sexRatioScore(Males, Females, Age, ageMin = 0, ageMax = max(Age), 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).

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. It is also assumed that the final age group is open, unless ageMax < max(Age).

Value

The value of the index.

References

\insertRef

accuracyun1952DemoTools \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)
sexRatioScore(Males, Females, Age)  # 2.2, matches PAS

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