s-news
[Top] [All Lists]

How to find the dates?

To: s-news@lists.biostat.wustl.edu
Subject: How to find the dates?
From: Peng Huang <huangp@musc.edu>
Date: Sun, 29 Feb 2004 17:41:39 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007
Dear All,

I have a very large cohort data that contains repeated measures. The data looks like:

id   days  event
1     0     0
1    30     0
1    50     0
1    95     1
1   120     1
1   147     0
1   180     0
2     0     0
2    75     0
2   100     0
3     0     0
3    37     1
3    80     1

I need help in finding the following survival times:
 1. For each subject, find the first day that event=1.
 2. If a subject never has event=1, then the last day is used with
    an indicator of censoring (say, censor=1).

For the above data, I expect to obtain:

id  days  censor
1    95      0
2   100      1
3    37      0

The next question bothers me more. Now I restrict to only subjects who have ever had event=1 (in this example, only subjects 1 and 3). How can I find the how many days it takes for the subject to return to event=0? As before, if a subject never returns to event=0, the last observation day is used with an indicator of censoring. In the above data, I expect to get

id  days  censor
1   52     0
3   43     1

Many thanks!

Regards,
Peng Huang




<Prev in Thread] Current Thread [Next in Thread>
  • How to find the dates?, Peng Huang <=