I am working with a dataset that has a about 10 variables for different treatments. If a patient underwent a particular treatment, then that treatment's variable has a date and the rest of the treatment variables are null. I want to make a new variable so that whichever treatment a patient underwent, the corresponding value is posted to a new variable. Example: Obs TrtA TrtB3 TrtGh TrtE8 1 . 01/01/2019 . . 2 . . 01/04/2019 . 3 . 01/12/2019 . . I want the output to look like: Obs Trt_date 1 01/01/2019 2 01/04/2019 3 01/12/2019 I am completely stuck after trying multiple if statements, treating each variable individually and together, and nothing is working. Please help!
... View more