smk_former: Former smokers: time since quit and time as smoker

Description Usage Arguments Details Value Examples

View source: R/smk_former.R

Description

Cleans the data on the time since quitting and time spent as a regular smoker among former smokers.

Usage

1

Arguments

data

Data table - the Health Survey for England data.

Details

The main issue to be overcome is that in the Health Surveys for England 2015+, time since quit and time spent as a smoker is provided in categories rather than single years. We simulate the single years by just picking a value at random within the time interval.

We also fill missing data: for children 8-15 years, we assume that missing values for former smokers = 1 year. For adults, we fill missing values with the average value for each age, sex and IMD quintile subgroup.

Value

Returns an updated data table with:

Examples

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

data <- read_2001()
data <- clean_age(data)
data <- clean_demographic(data)
data <- smk_status(data)
data <- smk_former(data)


## End(Not run)

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