# NOT RUN {
# Using pct_time_fun_cat() to create categorical percent time values
# between CCHS cycles.
# pct_time_fun_cat() is specified in variable_details.csv along with the CCHS
# variables and cycles included.
# To transform pct_time_der_cat10 across cycles, use rec_with_table() for
# each CCHS cycle.
# Since pct_time_der is a derived variable, you will have to specify the
# variables that are derived from it.
# Then by using merge_rec_data(), you can combine pct_time_der_cat10 across
# cycles.
library(cchsflow)
pct_time_cat2009_2010 <- rec_with_table(
cchs2009_2010_p, c(
"DHHGAGE_cont", "SDCGCBG",
"SDCGRES", "pct_time_der", "pct_time_der_cat10"
)
)
head(pct_time_cat2009_2010)
pct_time_cat2011_2012 <- rec_with_table(
cchs2011_2012_p, c(
"DHHGAGE_cont", "SDCGCBG",
"SDCGRES", "pct_time_der", "pct_time_der_cat10"
)
)
tail(pct_time_cat2011_2012)
combined_pct_time_cat <- merge_rec_data(pct_time_cat2009_2010,
pct_time_cat2011_2012)
head(combined_pct_time_cat)
tail(combined_pct_time_cat)
# }
Run the code above in your browser using DataLab