This function creates a derived categorical variable that flags for binge drinking based on the number drinks consumed on a single day.

binge_drinker_fun(
  DHH_SEX,
  ALW_1,
  ALW_2A1,
  ALW_2A2,
  ALW_2A3,
  ALW_2A4,
  ALW_2A5,
  ALW_2A6,
  ALW_2A7
)

Arguments

DHH_SEX

sex of respondent (1 - male, 2 - female)

ALW_1

Drinks in the last week (1 - yes, 2 - no)

ALW_2A1

Number of drinks on Sunday

ALW_2A2

Number of drinks on Monday

ALW_2A3

Number of drinks on Tuesday

ALW_2A4

Number of drinks on Wednesday

ALW_2A5

Number of drinks on Thursday

ALW_2A6

Number of drinks on Friday

ALW_2A7

Number of drinks on Saturday

Value

Categorical variable (binge_drinker) with two categories:

  1. 1 - binge drinker

  2. 2 - non-binge drinker

Details

In health research, binge drinking is defined as having an excess amount of alcohol in a single day. For males, this is defined as having five or more drinks; and for females it is four or more drinks. In the CCHS, respondents are asked to count the number of drinks they had during each day of the last week.

Examples

# Using binge_drinker_fun() to create binge_drinker values across CCHS cycles # binge_drinker_fun() is specified in variable_details.csv along with the # CCHS variables and cycles included. # To transform binge_drinker, use rec_with_table() for each CCHS cycle # and specify binge_drinker, along with the various alcohol and sex # variables. Then by using bind_rows() you can combine binge_drinker # across cycles. library(cchsflow) binge2001 <- rec_with_table( cchs2001_p, c( "ALW_1", "DHH_SEX", "ALW_2A1", "ALW_2A2", "ALW_2A3", "ALW_2A4", "ALW_2A5", "ALW_2A6", "ALW_2A7", "binge_drinker" ) )
#> No variable_details detected. #> Loading cchsflow variable_details
#> Using the passed data variable name as database_name
head(binge2001)
#> ALW_1 ALW_2A1 ALW_2A2 ALW_2A3 ALW_2A4 ALW_2A5 ALW_2A6 ALW_2A7 DHH_SEX #> 1 1 0 0 1 0 1 0 0 2 #> 2 NA(a) NA NA NA NA NA NA NA 2 #> 3 1 0 0 0 1 6 0 1 1 #> 4 2 NA NA NA NA NA NA NA 2 #> 5 1 0 0 0 0 0 8 0 2 #> 6 2 NA NA NA NA NA NA NA 1 #> binge_drinker #> 1 2 #> 2 NA(a) #> 3 1 #> 4 NA(a) #> 5 1 #> 6 NA(a)
binge2009_2010 <- rec_with_table( cchs2009_2010_p, c( "ALW_1", "DHH_SEX", "ALW_2A1", "ALW_2A2", "ALW_2A3", "ALW_2A4", "ALW_2A5", "ALW_2A6", "ALW_2A7", "binge_drinker" ) )
#> No variable_details detected. #> Loading cchsflow variable_details
#> Using the passed data variable name as database_name
tail(binge2009_2010)
#> ALW_1 ALW_2A1 ALW_2A2 ALW_2A3 ALW_2A4 ALW_2A5 ALW_2A6 ALW_2A7 DHH_SEX #> 195 NA(a) NA NA NA NA NA NA NA 2 #> 196 2 NA NA NA NA NA NA NA 2 #> 197 NA(a) NA NA NA NA NA NA NA 2 #> 198 NA(a) NA NA NA NA NA NA NA 1 #> 199 NA(a) NA NA NA NA NA NA NA 2 #> 200 2 NA NA NA NA NA NA NA 2 #> binge_drinker #> 195 NA(a) #> 196 NA(a) #> 197 NA(a) #> 198 NA(a) #> 199 NA(a) #> 200 NA(a)
combined_binge <- bind_rows(binge2001, binge2009_2010) head(combined_binge)
#> ALW_1 ALW_2A1 ALW_2A2 ALW_2A3 ALW_2A4 ALW_2A5 ALW_2A6 ALW_2A7 DHH_SEX #> 1 1 0 0 1 0 1 0 0 2 #> 2 NA(a) NA NA NA NA NA NA NA 2 #> 3 1 0 0 0 1 6 0 1 1 #> 4 2 NA NA NA NA NA NA NA 2 #> 5 1 0 0 0 0 0 8 0 2 #> 6 2 NA NA NA NA NA NA NA 1 #> binge_drinker #> 1 2 #> 2 NA(a) #> 3 1 #> 4 NA(a) #> 5 1 #> 6 NA(a)
tail(combined_binge)
#> ALW_1 ALW_2A1 ALW_2A2 ALW_2A3 ALW_2A4 ALW_2A5 ALW_2A6 ALW_2A7 DHH_SEX #> 395 NA(a) NA NA NA NA NA NA NA 2 #> 396 2 NA NA NA NA NA NA NA 2 #> 397 NA(a) NA NA NA NA NA NA NA 2 #> 398 NA(a) NA NA NA NA NA NA NA 1 #> 399 NA(a) NA NA NA NA NA NA NA 2 #> 400 2 NA NA NA NA NA NA NA 2 #> binge_drinker #> 395 NA(a) #> 396 NA(a) #> 397 NA(a) #> 398 NA(a) #> 399 NA(a) #> 400 NA(a)
# Using binge_drinker_fun() to generate binge_drinker with user-inputted # values. # # Let's say you are a male, and you had drinks in the last week. Let's say # you had 3 drinks on Sunday, 1 drink on # Monday, 6 drinks on Tuesday, 0 drinks on Wednesday, 3 drinks on Thurday, # 8 drinks on Friday, and 2 drinks on Saturday. Using binge_drinker_fun(), # we can check if you would be classified as a drinker. binge <- binge_drinker_fun(DHH_SEX = 1, ALW_1 = 1, ALW_2A1 = 3, ALW_2A2 = 1, ALW_2A3 = 6, ALW_2A4 = 0, ALW_2A5 = 3, ALW_2A6 = 8, ALW_2A7 = 2) print(binge)
#> [1] 1