# NOT RUN {
# Using SMKG207_fun() to derive age started to smoke daily values across
# CCHS cycles.
# SMKG207_fun() is specified in variable_details.csv along with the
# CCHS variables and cycles included.
# To transform SMKG207_A across cycles, use rec_with_table() for each
# CCHS cycle and specify SMKG207_A.
# For CCHS 2001-2014, only specify SMKG207_A.
# For CCHS 2015-2018, specify the parameters and SMKG207_A for former daily
# smoker age.
library(cchsflow)
agecigfd_2009_2010 <- rec_with_table(
cchs2009_2010_p, "SMKG207_A")
head(agecigfd_2009_2010)
agecigfd_2017_2018 <- rec_with_table(
cchs2017_2018_p,c(
"SMK_030","SMKG040","SMKG207_A"
)
)
tail(agecigfd_2017_2018)
combined_agecigfd <- suppressWarnings(merge_rec_data
(agecigfd_2009_2010,agecigfd_2017_2018))
head(combined_agecigfd)
tail(combined_agecigfd)
# }
Run the code above in your browser using DataLab