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

View source: R/smk_former.R

smk_formerR Documentation

Former smokers: time since quit and time as smoker

Description

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

Usage

smk_former(data)

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:

  • years_since_quit

  • years_reg_smoker

Examples


## Not run: 

library(hseclean)

data <- read_2017(root = "/Volumes/Shared/")
data <- clean_age(data)
data <- clean_demographic(data)
data <- smk_status(data)
data <- smk_former(data)


## End(Not run)


STAPM/hseclean documentation built on June 9, 2025, 4:50 a.m.