I need to make a new 3-level categorical variable that reflects whether a subject died of a certain class of drug in an overdose. The levels would be something like: "Class A only", "Class B only", "Class A + Class B".
Within the data frame, there are numerous (about 90) different individual drugs variables that are binary variables (0/1) which indicate if that drug was found in the subject's toxicology. What I would need to do is find a way to create this new factor variable that would tell us if one of the, say 25, drugs that are of Class A were found in that individual subject and then assign the new factor variable a value of "Class A" or "Class A + Class B" depending if a Class B drug was also present.
I'm overwhelmed with where to start. Any suggestions?