Dear STATA forum
I am having a great struggle with my STATA data, primarily is the Kaplan Meier curve only showing the failures.( See the attached )
I will try my best to give further details on my data since I am both a novice to STATA but also in writing in this forum. Thank you all for your patience.
These 349 patients had an operation 4 months ago, called TURB (Transurethral Resection of the Bladder, for those who are interested) Due to the high recurrence rate in this disease, the patients are ALL rutinely booked for a cystoscopy 4 months after TURB.
I have randomized the patients 1:1 into a control arm and an intervention arm. (PatientProtocol_n)
So the date of randomization is m4_visitDate
I feel that I wlll have to clarify the surveillance program a bit more detailed:
The follow up time is not the same for each patient. -unfortunately, so,
Because of that I have a variable dummy_m8_visitDate (1=yes, 0=no)
Each patient can have 0 - 3 tumores during time of follow up
( ALL ) m4_visitDate:& m4_PathologyFindings 1=tumor 2=normal 3=inflammation 4= other and . =no tumor found
( Only) if m4_visitDate==1, there is a need of.an other surveillance at:
m8_visitDate & m8_PathologyFindings 1=tumor 2=normal 3=inflammation 4=other and . = no tumor found
ALL patients are coming for their
m12_visitDate & m12_PathologyFindings ( 1, 2 3 4 and . as above )
I hope that it is somewhat clear and the following are shown in the nice CODE deliminators.
*count patients in the two groups ( 176 control, 173 intervention)
*see if all patients in this dataset has at least two visits (m4_VisitDate and m12_VisitDate)
* generate observationtime in years from first visit (m4_VisitDate) and last visit (m12_VisitDate)
* generate observationtime in years from patient´s latest TURB and last visit (m12_VisitDate - Patient_DateOfLatestTURB)
* in case of missing m8_VisitDate and no pathology found in m4_VisitDate
* generating observationtime in years from patient´s m8_visitDate==1 and Patient_DateOfLatestTURB when no tumor m4_visitDate
* Summarize and details
* checking pathology findings at each visit. If no pathology is found =.
* generate new variable if there is a tumor at all. 1 = yes 0= no
/* stset the data*/
*Kaplan meier curve with ci interval and risk table
And then see the attached file.
As you can see, it is only the the failures that are shown on the curve. Also the first long plateau on the curve is bothering me.
I am so very grateful for this oppotunity - and I am sorry, it this is way to much information.
Thanks,
Ditte
PS: I am hoping to do some other Kaplan Meier curves on the different visits and PathologyFindings
I am having a great struggle with my STATA data, primarily is the Kaplan Meier curve only showing the failures.( See the attached )
I will try my best to give further details on my data since I am both a novice to STATA but also in writing in this forum. Thank you all for your patience.
These 349 patients had an operation 4 months ago, called TURB (Transurethral Resection of the Bladder, for those who are interested) Due to the high recurrence rate in this disease, the patients are ALL rutinely booked for a cystoscopy 4 months after TURB.
I have randomized the patients 1:1 into a control arm and an intervention arm. (PatientProtocol_n)
So the date of randomization is m4_visitDate
I feel that I wlll have to clarify the surveillance program a bit more detailed:
The follow up time is not the same for each patient. -unfortunately, so,
Because of that I have a variable dummy_m8_visitDate (1=yes, 0=no)
Each patient can have 0 - 3 tumores during time of follow up
( ALL ) m4_visitDate:& m4_PathologyFindings 1=tumor 2=normal 3=inflammation 4= other and . =no tumor found
( Only) if m4_visitDate==1, there is a need of.an other surveillance at:
m8_visitDate & m8_PathologyFindings 1=tumor 2=normal 3=inflammation 4=other and . = no tumor found
ALL patients are coming for their
m12_visitDate & m12_PathologyFindings ( 1, 2 3 4 and . as above )
I hope that it is somewhat clear and the following are shown in the nice CODE deliminators.
*count patients in the two groups ( 176 control, 173 intervention)
Code:
tab PatientProtocol_n
Code:
br PatientProtocol_n m4_visitDate m12_visitDate
Code:
generate futime_yrs = ( m12_visitDate - m4_visitDate )/365.25 label variable futime_yrs "m12 - m4 follow up time"
* in case of missing m8_VisitDate and no pathology found in m4_VisitDate
Code:
generate futime_yrs_notumorm4_nom8visit if dummy_visit_m8==0 = ( m12_visitDate - Patient_DateOfLatestTURB )/365.25 label variable futime_yrs_notumorm4_nom8visit "m12 - Patient_DateOfLatestTURB"
Code:
generate futime_yrs_notumorm4_m8visit if dummy_visit_m8==1 = ( m8_visitDate - Patient_DateOfLatestTURB )/365.25 label variable futime_yrs_notumorm4_m8visit "m8_visitDate - Patient_DateOfLatestTURB if no tumor m4_visit (highrisk)"
Code:
summarize futime_yrs, detail
Code:
/* m12 - m4 follow up time ------------------------------------------------------------- Percentiles Smallest 1% .4900753 .1916496 5% .5859001 .3997262 10% .6132786 .4572211 Obs 349 25% .6516085 .4900753 Sum of Wgt. 349 50% .6872005 Mean .7302687 Largest Std. Dev. .136229 75% .7638603 1.147159 90% .9418207 1.182752 Variance .0185583 95% 1.026694 1.204654 Skewness 1.195845 99% 1.147159 1.336071 Kurtosis 5.698118*/ summarize futime_yrs_notumorm4_nom8visit /* Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- fut~om8visit | 156 1.012671 .0900095 .5338809 1.275838 */ summarize futime_yrs_notumorm4_nom8visit, detail /* m12 - Patient_DateOfLatestTURB ------------------------------------------------------------- Percentiles Smallest 1% .6543463 .5338809 5% .881588 .6543463 10% .9336071 .7310061 Obs 156 25% .9801506 .8049281 Sum of Wgt. 156 50% 1.008898 Mean 1.012671 Largest Std. Dev. .0900095 75% 1.05681 1.199179 90% 1.111567 1.218344 Variance .0081017 95% 1.149897 1.240246 Skewness -1.196008 99% 1.240246 1.275838 Kurtosis 9.365792 */ summarize futime_yrs_notumorm4_m8visit , detail /* m8_visitDate - Patient_DateOfLatestTURB if no tumor m4_visit (highrisk) ------------------------------------------------------------- Percentiles Smallest 1% .4900753 .3175907 5% .6132786 .4900753 10% .6351814 .5174538 Obs 193 25% .6735113 .5612594 Sum of Wgt. 193 50% .7118412 Mean .7229345 Largest Std. Dev. .0980745 75% .7611225 1.010267 90% .8104038 1.062286 Variance .0096186 95% .8788501 1.106092 Skewness 1.866754 99% 1.106092 1.385352 Kurtosis 15.67453 */
* checking pathology findings at each visit. If no pathology is found =.
Code:
tab PatientProtocol_n m4_PathologyFindings, miss /* Patient_Prot | m4_PathologyFindings ocol | tumor normal inflammat other . | Total -------------+-------------------------------------------------------+---------- control | 68 14 13 3 78 | 176 intervention | 62 11 12 0 88 | 173 -------------+-------------------------------------------------------+---------- Total | 130 25 25 3 166 | 349 */ tab PatientProtocol_n m8_PathologyFindings if dummy_visit_m8==0, missing /* | m8_Patholo Patient_Prot | gyFindings ocol | . | Total -------------+-----------+---------- control | 75 | 75 intervention | 81 | 81 -------------+-----------+---------- Total | 156 | 156 */ tab PatientProtocol_n m8_PathologyFindings if dummy_visit_m8==1, missing /* Patient_Prot | m8_PathologyFindings ocol | tumor normal inflammat other . | Total -------------+-------------------------------------------------------+---------- control | 37 5 8 1 50 | 101 intervention | 30 3 3 2 54 | 92 -------------+-------------------------------------------------------+---------- Total | 67 8 11 3 104 | 193 */ ***OBS : 193 + 156 = 349 patients!
Code:
tab PatientProtocol_n m12_PathologyFindings, missing /*Patient_Prot | m12_PathologyFindings ocol | tumor normal inflammat other . | Total -------------+-------------------------------------------------------+---------- control | 58 5 6 1 106 | 176 intervention | 38 3 9 1 122 | 173 -------------+-------------------------------------------------------+---------- Total | 96 8 15 2 228 | 349 */
Code:
generate pathology_all = ( m4_PathologyFindings==1 | m8_PathologyFindings==1 | m12_PathologyFindings==1) label variable pathology_all "if there is a tumor at m4_PathologyFindings | m8_PathologyFindings | m12_PathologyFindings"
Code:
stset futime_yrs, id(Patient_ID_n) failure(pathology_all==1) /* id: Patient_ID_n failure event: pathology_all == 1 obs. time interval: (_t0, futime_yrs] exit on or before: failure ------------------------------------------------------------------------------ 349 total observations 0 exclusions ------------------------------------------------------------------------------ 349 observations remaining, representing 349 subjects 183 failures in single-failure-per-subject data 254.864 total analysis time at risk and under observation at risk from t = 0 earliest observed entry t = 0 last observed exit t = 1.336071 */
Code:
sts graph, by ( PatientProtocol_n ) ci risktable /* failure _d: pathology_all == 1 analysis time _t: futime_yrs id: Patient_ID_n
As you can see, it is only the the failures that are shown on the curve. Also the first long plateau on the curve is bothering me.
I am so very grateful for this oppotunity - and I am sorry, it this is way to much information.
Thanks,
Ditte
PS: I am hoping to do some other Kaplan Meier curves on the different visits and PathologyFindings
Comment