2
$\begingroup$

I have a hospital based dataset which conatins information on patient details. Right from their visit, drugs, diagnosis, lab tests, and death info etc.

So, now I would like to compute their follow up time from the date of the 1st visit to last visit (when they visited hospital for the last time).

How can I do this? I couldn't find any tutorials online. While I did fine one resource but am not sure how can this be implemented in python?

There should be some readymade packages or tools which could this, but am unable to locate it.

I am trying to calculate something as shown in table 4 in this paper

Can guide me with this?

$\endgroup$
7
  • $\begingroup$ The question seems to say you want to compute the median time elapsed between the first and last visits. In that case, just take the sample median. But then, why mention other measurements like lab tests, etc--is there some connection? Also, table 4 in the linked paper compares various measurements between the first and last visits. I don't see any mention there of median time elapsed between visits. Could you clarify what you're asking? $\endgroup$
    – user20160
    Mar 4, 2021 at 14:23
  • $\begingroup$ In the table, we have median follow-up at the last line $\endgroup$
    – The Great
    Mar 4, 2021 at 14:25
  • $\begingroup$ How can I compute the median time elapsed (follow up)? YOu mean get the first and last day of visit for a patient.. compute their difference (in years/months etc).. Repeart the same for other patients and finally find the median of that difference values? $\endgroup$
    – The Great
    Mar 4, 2021 at 14:27
  • 1
    $\begingroup$ Yes, given your description of follow up time, that seems to be exactly what one might do. Of course, this ignores censoring; if the data is censored, you'd use some kind of survival analysis instead. $\endgroup$
    – user20160
    Mar 4, 2021 at 14:40
  • 1
    $\begingroup$ It doesn't seem to make sense to talk of "follow-up" if we are only considering the first and the last visit. If someone visits five times, then the follow-up should be the second visit (as a follow-up to the first one). And possibly later ones as well if the patient presented with a new complaint at, say, the third visit. $\endgroup$ Mar 4, 2021 at 14:58

1 Answer 1

1
$\begingroup$

Since the paper doesn't explain how it was calculated, I would assume they used the time until the last known followup for each participant, then calculated the usual median, and the first and third quartiles. In other words, they ignored the reason for why that was the person's last time of followup. So, if a person died on day 5, it's counted as 5; if they were lost to followup on day 30, that person is counted as 30; if they were still being followed at the time the data was analyzed, which was Day 1000, then it is 1000; etc. They end up with 12,242 numbers. Sort them. The median is the average of the 6,121 and 6,122 smallest numbers. The first and third quartiles are roughly equal to the 3,060 and 9,181st numbers sorted from smallest to largest. There are different conventions for exactly how to define the first and third quartile. There are several other methods used that incorporate the reasons for loss to followup, for example "reverse Kaplan-Meier" and the pros and cons of some of them are described here.

$\endgroup$
1
  • $\begingroup$ Thanks. Upvoted $\endgroup$
    – The Great
    Mar 5, 2021 at 2:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.