[R] Creating survival object

Thomas W Blackwell tblackw at umich.edu
Sun Oct 5 21:02:11 CEST 2003


Jens  -

After reading Help("Surv"), yes, I think you have interpreted
the two required arguments to Surv() correctly.  I don't know
of a ready-made function to do the transformation you illustrate.

If I had to program it myself, I would use  diff(), rep()  and
order().

-  tom blackwell  -  u michigan medical school  -  ann arbor  -

On Sun, 5 Oct 2003, Jens Schmidt wrote:

> I have survival data from a population:
>
> time    alive       treatment
> 0       20          A
> 3       12          A
> 5       10          A
> 8       7           A
> 10      7           A
> 15      5           A
> 20      5           A
>
> (time=0 is start of the experiment and initial number of individuals is
> alive=20; time=20 is end of experiment)
>
> If I don't misunderstood the survival documentation, always a survival
> object is required, i.e. created with function Surv(time, event)
>
> So I have to transform my data (assuming no censoring, event=0 is alive
> and event=1 is dead):
>
> time    event   treatment
> 20      0       A
> 20      0       A
> 20      0       A
> 20      0       A
> 20      0       A
> 15      1       A
> 15      1       A
> 8       1       A
> 8       1       A
> 8       1       A
> 5       1       A
> 5       1       A
> 3       1       A
> 3       1       A
> 3       1       A
> 3       1       A
> 3       1       A
> 3       1       A
> 3       1       A
> 3       1       A
>
> Is there a function or any other [R] code doing this?
>
> or
>
> Is it possible  to perform survival analysis direct from
> population data set?
>
> Thanks for any help
> Jens
> --
> Jens Schmidt                    TU Dresden -Inst. f. Hydrobiologie-
> Tel. +49-(0)351-463-36284       Mommsenstrasse 13
> Fax  +49-(0)351-463-37108       01062 Dresden
>                               	R.F.A.




More information about the R-help mailing list