Dear all,
I had a problem previously about dropping variables based on criteria.
This time, I will need to keep variables with the worst outcome (3 = higest severity/stage of disease). Below is a list of patients and their visit at hospital:
I would like to count number of unique patients with the highest stage of disease, regardless visitnumber, visit date etc. So I end up with a dataset like this:
Where serverest stage for Cindy was 2, for Bob 3, and Louis only 1
I made the duplicate-command, but I cant figure out how to sort and what criteria to set up to keep exactly the observatiosn with highest severity
Hope you can save my life, once again, thanks in advance!
Best wishes,
Malinna
I had a problem previously about dropping variables based on criteria.
This time, I will need to keep variables with the worst outcome (3 = higest severity/stage of disease). Below is a list of patients and their visit at hospital:
patient | stage of disease |
Cindy | 1 |
Cindy | 2 |
Bob | 1 |
Bob | 2 |
Bob | 3 |
Louis | 1 |
I would like to count number of unique patients with the highest stage of disease, regardless visitnumber, visit date etc. So I end up with a dataset like this:
patient | stage of disease |
Cindy | 2 |
Bob | 3 |
Louis | 1 |
I made the duplicate-command, but I cant figure out how to sort and what criteria to set up to keep exactly the observatiosn with highest severity
Hope you can save my life, once again, thanks in advance!
Best wishes,
Malinna
Comment