graduate_uniform: Convert arbitrary age groupings into single years of age.

View source: R/graduate.R

graduate_uniformR Documentation

Convert arbitrary age groupings into single years of age.

Description

Uniformly splits aggregate counts in age groups into single year age groups.

Usage

graduate_uniform(Value, Age, AgeInt, OAG = TRUE, OAvalue = 1)

Arguments

Value

numeric vector, presumably counts in grouped ages

Age

integer vector, lower bounds of age groups

AgeInt

integer vector, age interval widths

OAG

logical, default = TRUE is the final age group open?

OAvalue

Desired width of open age group. See details.

Details

Assumes that the population is uniformly distributed across each age interval, and that initial age intervals are integers greater than or equal to 1. If AgeInt is given, its final value is used as the interval for the final age group. If AgeInt is missing, then Age must be given, and the open age group is by default preserved OAvalue rather than split. To instead split the final age group into, e.g., a 5-year age class, either give AgeInt, or give Age, OAG = TRUE, and OAvalue = 5. Age be any age range, it does not need to start at 0.

Value

Numeric vector of counts for single year age groups.

Examples

MalePop <- c(9544406,7471790,11590109,11881844,11872503,12968350,
		11993151,10033918,14312222,8111523,15311047,6861510,13305117,7454575,
		9015381,10325432,9055588,5519173)
Ages <- seq(0, 85, by = 5)
graduate_uniform(MalePop, Age = Ages)

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