Re: [R] command in survival package

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Tue 24 Jan 2006 - 05:52:12 EST

On Mon, 23 Jan 2006, Linda Lei wrote:

> Thank you guys.
> But I tried the commands and I still get:
>
>> aml1<-aml[aml$group==1,]
>> aml1
> [1] time status x
> <0 rows> (or 0-length row.names)
>> esf.fit <- survfit(Surv(aml1$weeks,status) ~ 1)
> Error in Surv(aml1$weeks, status) : Time variable is not numeric
> In addition: Warning message:
> is.na() applied to non-(list or vector) in: is.na(time)
>
> which still looks confusing. Or are they should be applied in s-plus
> instead of R?

You *still* haven't said where the aml dataset comes from, but as I said before, it isn't the same as the one built in to R, so you need to load it somehow. The one in R has columns called "time", "status" and "x"; you appear to want one with columns "weeks","status", and "group", and with "group" being numeric rather than factor.

         -thomas



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 Received on Tue Jan 24 06:04:09 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:09 EST