I want to create a new variable in which "Yes" is if any of the 5 columns has "Yes" and "No" is if none of the columns were ever selected
I was able to sum them to figure out how many should be in each group, but I am unsure how to create the new variable
data$pyes <- sum(data$pocket_biopsy== "Yes" | data$pxray == "Yes" |
data$pxray == "Yes" |
data$pchemo == "Yes" |
data$pconsult == "Yes", na.rm=TRUE)
data$pno <-sum(data$pbiopsy== "No" & data$pxray == "No" &
data$pxray == "No" &
data$pchemo == "No" &
data$pconsult == "No", na.rm=TRUE)