[R] the Surv function

Armin Goralczyk agoralczyk at gmail.com
Thu May 3 19:15:54 CEST 2007


2007/5/2, Jennifer Dillon <jdillon at hsph.harvard.edu>:
> Hi,
>
> 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
>

I am not very familiar with this, but shouldn' t it be:

out <- Surv(fup, status==1)

where fup is your vector of time differences and status your vector to
denote censored events (e.g. 1 is an uncensored event and 2 for a
censored events). Have a look at section 12.2 of "introductory
statistics with R" by P. Dalgaard
-- 
A. Goralczyk
Göttingen, Ger.



More information about the R-help mailing list