[R] Trying to run simple survival program in R
Terry Therneau
therneau at mayo.edu
Fri Aug 8 14:31:08 CEST 2008
> Hey,
>
> I am just starting to learn R now and I typed in this simple survival
> program:
>
> library(survival)
> t <- c(10,13,18,19,23,30,36,38,54,56,59,75,93,97,104,107,107,107)
> c <- c(1,0,0,1,0,1,1,0,0,0,1,1,1,1,0,1,0,0)
> data <- Surv(t,c)
> km <- survfit(data)
> summary(km)
> Call: survfit(formula = data)
It is best to use a formula with the survfit program; the preferred way to call
it would be
> km <- survfit(Surv(t, c) ~1)
> print(km)
> plot(km)
etc.
Terry Therneau
More information about the R-help
mailing list