Re: [R] Calculating survival for set time intervals

2006-06-12 Thread Thomas Lumley
On Sat, 10 Jun 2006, Gregory Pierce wrote:

 Hello friends and fellow R users,

 I have successfully tabulated and entered my survival data into R and
 have generated survival curves. But I would like to be able to determine
 what the survival rates are now at one month, three months, six months
 and one year.

 I have a data set, via.wall, which I have entered into R, and which
 generates the following Surv object:

 Surv(Days,Status==1)
  [1] 648+   3  109  241   997  849+ 1053+ 539+ 121   42  490
 21  870+
 [16] 175   20  434  289  826+ 831+ 664  698+   5   24  655+  187+
 85+  65+
 [31] 547+   81   55+  69  499+ 448+   0  158+  31  246+ 230+  19
 118+  54
 [46]  48+  45+  21+ 670+ 585  558+ 544+ 494  481+ 474+ 472+ 461  447
 446+ 443+
 [61] 429+ 423+ 401  395+ 390  390+ 389+ 383+ 383+ 373+ 362+ 354  344+
 342  336+
 [76] 335+ 326+ 306  300+ 292  284+ 280+ 271  246+ 237+ 234  233+ 233
 230+ 230+
 [91] 226+ 225+ 218+ 215  211+ 199+ 191+ 191  190+ 184+ 169+ 163+ 161+
 153  150
 [106] 129+ 110+ 107+ 100+  84+  77+  69+  52+  38+  11+
 names(wall.via)
 [1] Description Patient Physician   MRN Age
 [6] Status  DaysCr  INR BR
 [11] MELDtype

 I can guess pretty accurately by looking at the graph what the survival
 rates are at each interval, but I would like to understand how to
 instruct R to calculate it. Hope I have made this clear. I am just a
 beginner, so forgive me if this is trivial. It just isn't clear to me.

You will have generated survival curves with survfit().  Give them to 
summary() and specify the times you want. For example, using one of the 
built-in data sets:

 fit - survfit(Surv(time, status) ~ x, data = aml)
 summary(fit,times=c(10,20,30,40))
Call: survfit(formula = Surv(time, status) ~ x, data = aml)

 x=Maintained
  time n.risk n.event survival std.err lower 95% CI upper 95% CI
10 10   10.909  0.08670.7541.000
20  7   20.716  0.13970.4881.000
30  5   10.614  0.15260.3770.999
40  3   20.368  0.16270.1550.875

 x=Nonmaintained
  time n.risk n.event survival std.err lower 95% CI upper 95% CI
10  8   40.667   0.136   0.44680.995
20  6   10.583   0.142   0.36160.941
30  4   30.292   0.139   0.11480.741
40  2   10.194   0.122   0.05690.664


-thomas


Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Calculating survival for set time intervals

2006-06-10 Thread Gregory Pierce
Hello friends and fellow R users,

I have successfully tabulated and entered my survival data into R and
have generated survival curves. But I would like to be able to determine
what the survival rates are now at one month, three months, six months
and one year.

I have a data set, via.wall, which I have entered into R, and which
generates the following Surv object:

Surv(Days,Status==1)
  [1] 648+   3  109  241   997  849+ 1053+ 539+ 121   42  490
21  870+
 [16] 175   20  434  289  826+ 831+ 664  698+   5   24  655+  187+
85+  65+
 [31] 547+   81   55+  69  499+ 448+   0  158+  31  246+ 230+  19
118+  54
 [46]  48+  45+  21+ 670+ 585  558+ 544+ 494  481+ 474+ 472+ 461  447
446+ 443+
 [61] 429+ 423+ 401  395+ 390  390+ 389+ 383+ 383+ 373+ 362+ 354  344+
342  336+
 [76] 335+ 326+ 306  300+ 292  284+ 280+ 271  246+ 237+ 234  233+ 233
230+ 230+
 [91] 226+ 225+ 218+ 215  211+ 199+ 191+ 191  190+ 184+ 169+ 163+ 161+
153  150
[106] 129+ 110+ 107+ 100+  84+  77+  69+  52+  38+  11+
 names(wall.via)
 [1] Description Patient Physician   MRN Age
 [6] Status  DaysCr  INR BR
[11] MELDtype

I can guess pretty accurately by looking at the graph what the survival
rates are at each interval, but I would like to understand how to
instruct R to calculate it. Hope I have made this clear. I am just a
beginner, so forgive me if this is trivial. It just isn't clear to me.

Thanks,
Greg

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html