# NOT RUN {
# Using low_drink_score_fun() to create low_drink_score values across
# CCHS cycles low_drink_score_fun() is specified in variable_details.csv
# along with the CCHS variables and cycles included.
# To transform low_drink_score, use rec_with_table() for each CCHS cycle
# and specify low_drink_score, along with the various alcohol and sex
# variables.
# Using merge_rec_data(), you can combine low_drink_score across cycles.
library(cchsflow)
low_drink2001 <- rec_with_table(
cchs2001_p, c(
"DHH_SEX", "ALWDWKY", "low_risk_score"
)
)
head(low_drink2001)
low_drink2009_2010 <- rec_with_table(
cchs2009_2010_p, c(
"DHH_SEX", "ALWDWKY", "low_risk_score"
)
)
tail(low_drink2009_2010)
combined_low_drink <- bind_rows(low_drink2001,
low_drink2009_2010)
head(combined_low_drink)
tail(combined_low_drink)
# }
Run the code above in your browser using DataLab