[R] the Surv function
christos at nuverabio.com
Wed May 2 05:42:24 CEST 2007
Try using the following (without naming the arguments) - it should work.
I think what is happening is that if you use one or two arguments (unnamed),
Surv assumes that you have right-censored data, with the first argument
being time and the second being status. By specifying 'event' as you did,
Surv assumes that you have 3 arguments of "type"=counting and it is looking
for the ending time required by the counting data format and this is why you
got the error.
If you are not afraid of R code, type Surv (without the parentheses) to see
the code behind the function.
Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Woburn, MA 01801
> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Jennifer Dillon
> Sent: Tuesday, May 01, 2007 11:16 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] the Surv function
> I'm trying to do a simple survival analysis on some data, and
> I'm having the following problem (here's my code and the
> error message):
> out <- Surv(fup,event=status)
> Error in Surv(fup, event = status) : argument "time2" is
> missing, with no default
> >From reading the documentation, it seems that I should be able to
> write: Surv(time1, event) if my data is right-censored, which it is.
> Thanks a million,
> Jennifer Dillon
> Doctoral Student
> Harvard Biostatistics
> Room 414B, Building 1
> [[alternative HTML version deleted]]
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help