Convert a "choose all that apply" Question Into a Binary Word
Convert a "choose all that apply" Question Into a Binary Word
This function takes a data frame holding binary variables with values corresponding to a dummy-coded "choose all that apply" question. It can be used for any binary word problem.
A character vector with length equal to the rows of df, including one letter or underscore for each column of df. For instance, if df
has one column for each of the eight options of the Nacho Craving Index example instrument (https://libguides.du.edu/c.php?g=948419&p=6839916), with a row containing the values "Chips" (checked), "Yellow cheese" (unchecked), "Orange cheese" (checked), "White cheese" (checked), "Meat" (checked), "Beans" (unchecked), "Tomatoes" (unchecked) and "Peppers" (checked), then the character string corresponding to that row will be "a_cde__h". The underscores represent that the options for "Yellow cheese", "Beans", and "Tomatoes" were left unchecked.