shift_census_ages_to_cohorts | R Documentation |
Matches the (single) ages of a census to single cohorts. For use in intercensal interpolations. Ages are potentially blended to match single cohort line assuming that the population in each age is uniformly distributed over the age group.
shift_census_ages_to_cohorts(
pop,
age,
date,
censusYearOpt = "frac",
OAG = TRUE
)
pop |
numeric vector. Population counts in age groups, presumably from a census with an exact reference date. |
age |
integer vector. Lower bound of single age groups |
date |
Either a |
censusYearOpt |
character or
|
OAG |
logical. Is the highest age group an open age? If |
pop <- seq(10000,100,length.out = 101)
age <- 0:100
d1 <- "2020-01-01"
d2 <- "2020-07-01"
d3 <- "2020-12-21"
shift_census_ages_to_cohorts(pop, age, d1)
shift_census_ages_to_cohorts(pop, age, d2)
shift_census_ages_to_cohorts(pop, age, d3)
shift_census_ages_to_cohorts(pop, age, 2020.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.