Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: stset with different start times

From   Lars Folkestad <>
To   "" <>
Subject   Re: st: stset with different start times
Date   Wed, 26 Sep 2012 14:09:56 +0200

Dear list

I figured it out:

Firstly i generated a "at risk date" that was equal to birth date if born
after 1977 and 1th jan 1977 if born prior to 1977

Then i used the following:

stset D_DOD, failure(died) origin(time bdate) enter(time r_date)

D_DOD = date of death/31th of dec 2009
died is died within the study time
Bdate is the time of birth
r_time is the "at risk date"

This should handle the left truncation problem.

Please correct me if thats all wrong.


Den 26/09/12 13.18 skrev "Lars Folkestad" <>:

>Dear list
>I know this has been asked before, but i cannot see how to apply it to my
>I have date from a register where cases can be entered if they are
>diagnosed between 1977-2009. Patients are entered at the time of
>diagnosis NOT the time of birth.
>I am interested to draw a Kaplan-Meier curve for the patients in the
>register. My problem is that to avoid bias due to left truncation i want
>to enter the patients born prior to 1977 at their age in 1977 and NOT
>their time of birth.
>My variable names are:
>Date of birth = dob
>Date of death=dod
>Age at death/end of study = d_age
>Age at 1977 (given born prior to 1977) = age_77
>What i have done so far is:
>.gen d_age = dod - dob
>.gen byte died = dod < mdy(31,12,2009)
>.stset age, died(died) scale(365.25)
>But this does not take into account the above.
>Thank you for your help.
>*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index