I have a dataset (example attached) in which the same identification number occurs on multiple lines and has multiple observations. In the example I have three important variables- LOS, culture, and organism. For this example data set patient number 23 started in the emergency department and then was eventually admitted, making them count as an "admitted patient". I need to count how many admitted patients had a blood or sputum culture performed. Unfortunately, patient number 23 had the cultures performed in the emergency department and thus the positive value for "culture" does not occur on the same observation line as LOS (indicating that they were admitted). Is there any way to collapse the variables in my dataset and only keep the ones that at some point had an positive admission as well as a blood or sputum culture?
-
Login or Register
- Log in with
Comment