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

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.

Value

Numeric vector of counts for single year age groups.

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.

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)
#> 0 1 2 3 4 5 6 7 8 9 #> 1908881 1908881 1908881 1908881 1908881 1494358 1494358 1494358 1494358 1494358 #> 10 11 12 13 14 15 16 17 18 19 #> 2318022 2318022 2318022 2318022 2318022 2376369 2376369 2376369 2376369 2376369 #> 20 21 22 23 24 25 26 27 28 29 #> 2374501 2374501 2374501 2374501 2374501 2593670 2593670 2593670 2593670 2593670 #> 30 31 32 33 34 35 36 37 38 39 #> 2398630 2398630 2398630 2398630 2398630 2006784 2006784 2006784 2006784 2006784 #> 40 41 42 43 44 45 46 47 48 49 #> 2862444 2862444 2862444 2862444 2862444 1622305 1622305 1622305 1622305 1622305 #> 50 51 52 53 54 55 56 57 58 59 #> 3062209 3062209 3062209 3062209 3062209 1372302 1372302 1372302 1372302 1372302 #> 60 61 62 63 64 65 66 67 68 69 #> 2661023 2661023 2661023 2661023 2661023 1490915 1490915 1490915 1490915 1490915 #> 70 71 72 73 74 75 76 77 78 79 #> 1803076 1803076 1803076 1803076 1803076 2065086 2065086 2065086 2065086 2065086 #> 80 81 82 83 84 85 #> 1811118 1811118 1811118 1811118 1811118 5519173