Dear all,
Thanks in advance for anyone who can enlighten me.
I have a question regarding the extension of an analysis for which I have already received invaluable help from Clyde Schechter a few days ago.
I have a series of patients admitted to multiple different departments.
Some of these patients have died, while others have not.
Some have had Covid, while others have not.
Now, I need to study the incidence of mortality and the time-to Covid positivity to understand if the virus has spread more rapidly in certain departments or months.
As far as estimating the mortality incidence is concerned, there are no problems.
Now, however, we want to insert Covid swab data into the dataset.
There is a problem: some patients have become infected, recovered, and then become reinfected (up to 3 infections).
I have a clear idea of what type of survival analysis model to use (I would go with mestreg, to account for more levels of data clustering).
However, how should I set up the dataset? I have a solution in mind but it could be excessively complex and perhaps due to my poor data management skills.
Please see a data simulation below and let's take the first patient (id==1) as an example.
The patient tested positive on 5 May 2023 while in cardiology. Then, she was transferred to oncology where she is tested negative on 01 June 2023, before returning to cardiology on 14 June 2023.
Now...If the patient had another positive test, let's say on 10 June 2023 in oncology, and then tested negative again on 03 July 2023, how would you report this second negativity in the dataset?
Remember that, on the same dataset, I need to keep track of the admission and discharge dates from the various departments because I need to estimate both mortality and positivity incidence, across different months and departments.
Thanks to anyone with an idea.
Gianfranco
Thanks in advance for anyone who can enlighten me.
I have a question regarding the extension of an analysis for which I have already received invaluable help from Clyde Schechter a few days ago.
I have a series of patients admitted to multiple different departments.
Some of these patients have died, while others have not.
Some have had Covid, while others have not.
Now, I need to study the incidence of mortality and the time-to Covid positivity to understand if the virus has spread more rapidly in certain departments or months.
As far as estimating the mortality incidence is concerned, there are no problems.
Now, however, we want to insert Covid swab data into the dataset.
There is a problem: some patients have become infected, recovered, and then become reinfected (up to 3 infections).
I have a clear idea of what type of survival analysis model to use (I would go with mestreg, to account for more levels of data clustering).
However, how should I set up the dataset? I have a solution in mind but it could be excessively complex and perhaps due to my poor data management skills.
Please see a data simulation below and let's take the first patient (id==1) as an example.
The patient tested positive on 5 May 2023 while in cardiology. Then, she was transferred to oncology where she is tested negative on 01 June 2023, before returning to cardiology on 14 June 2023.
Now...If the patient had another positive test, let's say on 10 June 2023 in oncology, and then tested negative again on 03 July 2023, how would you report this second negativity in the dataset?
Remember that, on the same dataset, I need to keep track of the admission and discharge dates from the various departments because I need to estimate both mortality and positivity incidence, across different months and departments.
Thanks to anyone with an idea.
Gianfranco
Code:
* Example generated by -dataex-. For more info, type help dataex clear input byte id double age byte sex int(admission_date discharge_date) byte dead str10 department int swab_date byte swaboutcome 1 55 0 23135 23157 0 "cardiology" 23145 1 1 55 0 23158 23174 0 "oncology" 23162 0 1 55 0 23175 23206 1 "cardiology" 23194 0 . . . . . . "" . . . . . . . . "" . . . . . . . . "" . . . . . . . . "" . . 2 45 1 23147 23179 0 "cardiology" 23165 0 2 46 1 23180 23335 0 "oncology" 23206 0 3 58 0 23079 23101 0 "oncology" 23084 0 4 58 0 23128 23158 1 "oncology" 23151 1 5 63 0 23055 23079 0 "cardiology" 23070 0 7 70 1 23053 23077 1 "oncology" 23071 1 8 53 0 23357 23382 0 "cardiology" 23378 0 end format %td admission_date format %td discharge_date format %td swab_date