Splus Log Handout Related to Stratified Survival Curves, Survival Differences, and Cox Models ======================================================== Let's begin by seeing how to call for stratified survival curves in Splus. The unifying theme throughout seems to be that a "formula" used in specifying survift or survdiff or coxph can be made stratified through syntax like: Surv(Time,Dth) ~ Group + strata(Strat) (I) Survival Curves. Consider first the Bone Marrow Transplant data,downloaded as frame "BMT" from first 5 columns of the dataset from Section 1.3 of the book. > ScurvA <- survfit(Surv(Dtime,Dind) ~ Gp, data=BMT) ScurvB <- survfit(Surv(Dtime,Dind) ~ strata(Gp), data=BMT) ### There is no difference between the two objects produced in this ### way. In both cases, they plot as three separately fitted ### survival curves which could also have been created with ### a for-loop. (II) Survival Differences. Here let us artificially create "Strata" according to whether Relapse (Rtime) proecedes Death (Dtime). [This is not an advisable way to analyze the data: ity is done for illustrative purposes only !] > SdiffA <- survdiff(Surv(Dtime,Dind) ~ Gp, data=BMT) Call: survdiff(formula = Surv(Dtime, Dind) ~ Gp, data = BMT) N Observed Expected (O-E)^2/E (O-E)^2/V Gp=1 38 24 21.3 0.337 0.462 Gp=2 54 23 38.8 6.413 12.562 Gp=3 45 34 20.9 8.190 11.162 Chisq= 15.2 on 2 degrees of freedom, p= 0.000496 > SdiffB <- survdiff(Surv(Dtime,Dind) ~ Gp + strata(I(Rtime < Dtime)), data=BMT) Call: survdiff(formula = Surv(Dtime, Dind) ~ Gp + strata(I(Rtime < Dtime)), data = BMT) N Observed Expected (O-E)^2/E (O-E)^2/V Gp=1 38 24 22.2 0.149 0.21 Gp=2 54 23 35.7 4.490 8.49 Gp=3 45 34 23.2 5.063 7.36 Chisq= 10.3 on 2 degrees of freedom, p= 0.00589 ### OK, so these are different now: the point is that the ### analysis in SdiffB is stratified according to whether ### or not Rtime < Dtime > table(BMT$Rtime < BMT$Dtime, BMT$Gp) 1 2 3 FALSE 25 45 24 TRUE 13 9 21 ### In the following two "survdiff" calls, we obtain observed ### and expected within the three groups, for each of the ### two artificial "strata". > survdiff(formula = Surv(Dtime, Dind) ~ Gp, data = BMT[ BMT$Rtime < BMT$Dtime,]) ... N Observed Expected (O-E)^2/E (O-E)^2/V Gp=1 13 13 11.9 0.0937 0.136 Gp=2 9 7 14.8 4.1129 6.801 Gp=3 21 21 14.3 3.1916 5.026 Chisq= 7.8 on 2 degrees of freedom, p= 0.0205 > survdiff(formula = Surv(Dtime, Dind) ~ Gp, data = BMT[ BMT$Rtime == BMT$Dtime,]) N Observed Expected (O-E)^2/E (O-E)^2/V Gp=1 25 11 10.24 0.0569 0.0774 Gp=2 45 16 20.85 1.1279 2.3770 Gp=3 24 13 8.91 1.8729 2.4246 Chisq= 3.1 on 2 degrees of freedom, p= 0.215 ### Note that the observed and expected, summed across the ### two "strata", give the groupwise ### observed and expected in SdiffB. (III) Cox models. THIS PART WILL BE ADDED OVER THE NEXT COUPLE OF CLASSES, AS WE STUDY SINGLE-STRATUM COX MODEL FITTING USING Coxph AND THEN GENERALIZE TO MULTIPLE STRATA. ==================================================================