Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

More Input Variables



> l.coxph <- coxph(Surv(time, status) ~ age + ph.ecog, data=lung, method="breslow")
> summary(l.coxph)



Call:
coxph(formula = Surv(time, status) ~ age + ph.ecog, data = lung, 
    method = "breslow")

  n=227 (1 observation deleted due to missingness)

            coef exp(coef) se(coef)     z Pr(>|z|)    
age     0.011269  1.011333 0.009319 1.209 0.226544    
ph.ecog 0.442693  1.556894 0.115819 3.822 0.000132 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

        exp(coef) exp(-coef) lower .95 upper .95
age         1.011     0.9888     0.993     1.030
ph.ecog     1.557     0.6423     1.241     1.954

Rsquare= 0.08   (max possible= 0.999 )
Likelihood ratio test= 18.99  on 2 df,   p=0.00007506
Wald test            = 19.19  on 2 df,   p=0.00006796
Score (logrank) test = 19.49  on 2 df,   p=0.00005873

Predict male survival from age and medical scores.



> l.coxph <- coxph(l.Surv ~ age + ph.ecog + ph.karno + pat.karno, data=lung, 
                      subset=sex==1)

Display results:



> summary(l.coxph)



Call:
coxph(formula = l.Surv ~ age + ph.ecog + ph.karno + pat.karno, 
    data = lung, subset = sex == 1)

  n=134 (4 observations deleted due to missingness)

               coef exp(coef)  se(coef)      z Pr(>|z|)   
age        0.022465  1.022719  0.012216  1.839  0.06593 . 
ph.ecog    0.665452  1.945370  0.225712  2.948  0.00320 **
ph.karno   0.025553  1.025883  0.011778  2.170  0.03004 * 
pat.karno -0.011059  0.989002  0.008892 -1.244  0.21361   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

          exp(coef) exp(-coef) lower .95 upper .95
age           1.023     0.9778    0.9985     1.048
ph.ecog       1.945     0.5140    1.2499     3.028
ph.karno      1.026     0.9748    1.0025     1.050
pat.karno     0.989     1.0111    0.9719     1.006

Rsquare= 0.125   (max possible= 0.998 )
Likelihood ratio test= 17.87  on 4 df,   p=0.001311
Wald test            = 18.3  on 4 df,   p=0.001076
Score (logrank) test = 18.6  on 4 df,   p=0.000942

Evaluate the proportional hazards assumption:



> cox.zph(l.coxph)



              rho   chisq     p
age       0.00534 0.00363 0.952
ph.ecog   0.02851 0.09155 0.762
ph.karno  0.16922 2.43462 0.119
pat.karno 0.02988 0.12793 0.721
GLOBAL         NA 5.62951 0.229

Now predict:



> head(lung$time)



[1]  306  455 1010  210  883 1022



> head(predict(l.coxph, lung))



        [,1]
1  0.2448093
2 -0.4448432
3 -0.7144239
4  0.3052630
5 -0.3690295
6 -0.5561473



Copyright © Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010