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, statalist.org is already up and running.

# Re: st: stset with different start times

 From Lars Folkestad To "statalist@hsphsun2.harvard.edu" 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)
scale(365.25)

Where
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.

lars

>Dear list
>
>I know this has been asked before, but i cannot see how to apply it to my
>data.
>
>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.
>
>
>Lars
>
>*
>*   For searches and help try:
>*   http://www.stata.com/help.cgi?search
>*   http://www.stata.com/support/statalist/faq
>*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```