I am working on a dataset on injuries. The dataset has 1 column each for the anatomic location of injury (analoc_eye, analoc_head, analoc_neck, analoc_chest, analoc_back, etc). The responses are coded either as YES or NO.
I’d like to create a new column (outcome_analoc_multiple) which codes as 1 if a case has 2 or more of the analoc_ columns with a YES, and 0 if there is only 1 analoc_ column with a YES. This column will eventually be used for logistic regression as an outcome (multiple anatomic locations of injuries).
I have thought about using ifelse or case_when, but I don’t know how to phrase the if or LHS statement to say “if 2 or more analoc_ columns are YES.”
Any thoughts? Thank you!