select_data.Rd
Selects the variables required for analysis and selects only the rows without missing data for specified variables.
Data table - the Health Survey for England dataset.
Integer vector - the ages in single years to retain (defaults to 8 to 89 years).
Integer vector - the years in single years to retain.
Character vector - the names of the variables to keep.
Character vector - the names of the variables on which the selection of complete cases will be based.
Returns a reduced version of data
if (FALSE) {
data <- select_data(data, keep_vars = c("age", "sex", "imd_quintile", "cig_smoker_status"))
}