construct_age_groups
construct_age_groups.Rd
Derives agegroupings according to how the parameters are set.
Arguments
- age_in_yrs_col
name of the age in years variable used to derive group.
- start_age
this is the lowest age for the first group, excluding < 1, if set to 5 then first group will be 01-04.
- max_band
this is the final band in the age groupings e.g. 85+.
- step_size
this is the width of each age band in years.
- under_1
set to TRUE if you require an 'under one year old' group.
Examples
data <- data %>%
mutate(AGEGROUP = construct_age_groups(AGEINYRS, start_age = 5, max_band = 95,
step_size = 5, under_1 = TRUE))
#> Error in data %>% mutate(AGEGROUP = construct_age_groups(AGEINYRS, start_age = 5, max_band = 95, step_size = 5, under_1 = TRUE)): could not find function "%>%"
data <- data %>%
mutate(AGEGROUP = construct_age_groups(AGEINYRS, start_age = 30, max_band = 95,
step_size = 5, under_1 = FALSE))
#> Error in data %>% mutate(AGEGROUP = construct_age_groups(AGEINYRS, start_age = 30, max_band = 95, step_size = 5, under_1 = FALSE)): could not find function "%>%"