Hello, I am looking to create a new variable that will count the occurrence of a set of columns if they have characters inside of them. The dataset I am working with contains ER visits within a year of people who eventually died from X. So there are roughly 3 thousand visits and they are already sorted by a variable that ensures each patient has all there er visits in sequence. So for example if patient A went to the ER 5 times in the past year, there are 5 rows with different information but all the same patient id. I want to form a new variable that counts the number of procedures per patient. Each visit has a procedure1-procedure20 with some missing and a lot of blank. Is there any way to form a count array or something that can count each procedure and then filter it by patient, then to add up the total? Thank you.
... View more