Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: stset with different start times
From
Lars Folkestad <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: stset with different start times
Date
Wed, 26 Sep 2012 13:18:53 +0200
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.
Thank you for your help.
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/