Description Usage Arguments Details Value Examples
Cleans the data on the time since quitting and time spent as a regular smoker among former smokers.
1 |
data |
Data table - the Health Survey for England data. |
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.
Returns an updated data table with:
years_since_quit
years_reg_smoker
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.