clean_age: Age variables

Description Usage Arguments Details Value Examples

View source: R/clean_age.R

Description

Processes the data on age.

Usage

1

Arguments

data

Data table - the Health Survey for England dataset.

Details

From 2015 onwards, the HSE no longer supplies age in single years (to prevent individual identification). For our modelling, we require age in single years, so we apply a method that randomly assigns an age in single years to individuals for whom we only have an age category. The age categories we work with are: 0-1, 2-4, 5-7, 8-10, 11-12, 13-15, 16-17, 18-19, 20-24, 25-29, 30-34, 35-39, 40-44, 45-49, 50-54, 55-59, 60-64, 65-69, 70-74, 75-79, 80-84, 85-89, 90+. These categories are the finest scale version of age that is available for years 2015+. We then select only individuals younger than 90 years for our modelling.

Value

Returns an updated version of data with the new age variables: age in single years, age in the categories above, and birth cohort.

Examples

1
2
3
4
5
6
7
8
## Not run: 

data_2016 <- read_2016()

data_2016 <- clean_age(data = data_2016)


## End(Not run)

dosgillespie/hseclean documentation built on May 2, 2020, 1:15 a.m.