This function creates a derived variable for daily leisure energy expenditure.A MET is a conceptual value that represents energy expended during physical activity. The volume of activity is calculated by multiplying the amount of minutes of activity (by level of intensity) by the MET value associated with that intensity. A MET (metabolic equivalent) is the energy cost of activity expressed as kilocalories expended per kilogram of body weight per hour of activity.

In CCHS 2001-2014, PACDEE is the variable used to determine the daily expenditure of leisure activity for all ages. In CCHS 2015-2018, ages 12-17 and 18+ years old have separate activity variables, where 12-17 year olds use PAY_XXX and 18+ year olds use PAA_XXX. Leisure activity is not directly measured. We used the derived variable, PAADVVOL, and removed active transportation in the new function. With this function, we combined leisure activity for ages 12+. We calculate the daily energy expenditure which uses the frequency and duration per session of the physical activity as well as the MET value (3 METS for leisure and 6 METS for vigorous activity).

EE (Daily Energy Expenditure) = ((N X D X METvalue) / 60)/7 Where: N = the number of times a respondent engaged in an activity over a 7 day period D = the average duration in minutes of the activity MET value = the energy cost of the activity expressed as kilocalories expended per kilogram of body weight per hour of activity (kcal/kg per hour)

energy_exp_fun(
DHHGAGE_cont,
PAA_045,
PAA_050,
PAA_075,
PAA_080,
PAYDVTOA,
PAYDVVIG,
PAYDVDYS
)

## Arguments

DHHGAGE_cont continuous age variable. number of hours of sports, fitness, or recreational activity that make you sweat or breathe harder for CCHS 2015-2018 for 18+ years old. number of minutes of sports, fitness, or recreational activity that make you sweat or breathe harder for CCHS 2015-2018 for 18+ years old. number of hours of other physical activity while at work, home or volunteering for CCHS 2015-2018 for 18+ years old. number of minutes of other physical activity while at work, home or volunteering for CCHS 2015-2018 for 18+ years old. number of active days - 7 day for CCHS 2015-2018 for 18+ years old. number of minutes of vigorous activity over 7 days or CCHS 2015-2018 for 18+ years old. total minutes of other activities - 7 day for CCHS 2015-2018 for 12-17 years old. total minutes of physical activity - leisure - 7 day for CCHS 2015-2018 for 12-17 years old. total minutes - vigorous physical activity - 7 d for CCHS 2015-2018 for 12-17 years old. total days physically active - 7 day for CCHS 2015-2018 for 12-17 years old.

## Value

Continuous variable for energy expenditure (energy_exp)

## Examples

# Using energy_exp_fun() to create energy expenditure values across CCHS
# cycles
# energy_exp_fun() is specified in variable_details.csv along with the CCHS
# variables and cycles included.

# To transform energy_exp across cycles, use rec_with_table() for each
# CCHS cycle and specify energy_exp, along with each activity variable.
# Then by using merge_rec_data(), you can combine energy_exp across
# cycles

library(cchsflow)
energy_exp2015_2016 <- rec_with_table(
cchs2015_2016_p, c(
"DHHGAGE_cont", "PAA_045", "PAA_050", "PAA_075", "PAA_080", "PAADVDYS",
)
)
#> No variable_details detected.
#>               Loading cchsflow variable_details#> Using the passed data variable name as database_name#> NOTE for PAA_075: Examples include carrying heavy loads, shoveling, and household chores such as vacuuming or washing windows.  Only include activities that lasted aminimum of 10 continuous minutes.#> NOTE for PAA_080: Examples include carrying heavy loads, shoveling, and household chores such as vacuuming or washing windows.  Only include activities that lasted aminimum of 10 continuous minutes.
#> 1           62       0       0       0       0        0        0       NA
#> 2           42       1      20       1       0        4       70       NA
#> 3           16      NA      NA      NA      NA       NA       NA      570
#> 4           57      22      45       8       0        7        0       NA
#> 5           47       3       0       0       0        2        0       NA
#> 6           62       3      30       2       0        7        0       NA
#>   PAYDVDYS PAYDVTOA PAYDVVIG energy_exp
#> 1       NA       NA       NA   0.000000
#> 2       NA       NA       NA   6.000000
#> 3       NA        0       NA         NA
#> 4       NA       NA       NA  92.250000
#> 5       NA       NA       NA   2.571429
#> 6       NA       NA       NA  16.500000
energy_exp2017_2018 <- rec_with_table(
cchs2017_2018_p, c(
"DHHGAGE_cont", "PAA_045", "PAA_050", "PAA_075", "PAA_080", "PAADVDYS",
)
)
#> No variable_details detected.
#>               Loading cchsflow variable_details#> Using the passed data variable name as database_name#> NOTE for PAA_075: Examples include carrying heavy loads, shoveling, and household chores such as vacuuming or washing windows.  Only include activities that lasted aminimum of 10 continuous minutes.#> NOTE for PAA_080: Examples include carrying heavy loads, shoveling, and household chores such as vacuuming or washing windows.  Only include activities that lasted aminimum of 10 continuous minutes.
tail(energy_exp2015_2016)
#> 195           62       0       0       0       0        0        0       NA
#> 196           67       0       0       4       0        3        0       NA
#> 197           85       0       0       0       0        7        0       NA
#> 198           47       6       0      10       0        7        0       NA
#> 199           52       3       0       0       0        3        0       NA
#> 200           47       0       0       0       0        0        0       NA
#>     PAYDVDYS PAYDVTOA PAYDVVIG energy_exp
#> 195       NA       NA       NA   0.000000
#> 196       NA       NA       NA   5.142857
#> 197       NA       NA       NA   0.000000
#> 198       NA       NA       NA  48.000000
#> 199       NA       NA       NA   3.857143
#> 200       NA       NA       NA   0.000000
combined_energy_exp <- suppressWarnings(merge_rec_data(energy_exp2015_2016,
energy_exp2017_2018))

#> 1           62       0       0       0       0        0        0       NA
#> 2           42       1      20       1       0        4       70       NA
#> 3           16      NA      NA      NA      NA       NA       NA      570
#> 4           57      22      45       8       0        7        0       NA
#> 5           47       3       0       0       0        2        0       NA
#> 6           62       3      30       2       0        7        0       NA
#>   PAYDVDYS PAYDVTOA PAYDVVIG energy_exp
#> 1       NA       NA       NA   0.000000
#> 2       NA       NA       NA   6.000000
#> 3       NA        0       NA         NA
#> 4       NA       NA       NA  92.250000
#> 5       NA       NA       NA   2.571429
#> 6       NA       NA       NA  16.500000tail(combined_energy_exp)
#> 400       NA       NA       NA  169.50000