[R] Convert SAS code to R code about survival analysis

karena dr.jzhou at gmail.com
Mon Jun 13 21:39:48 CEST 2011


Hi, I am working on transforming a SAS code to R code.

It's about the survival analysis and the SAS code is as below:
--------------------------------------
proc lifetest data=surdata plot=(s);
time surv*censht(1);
strata educ;
title 'Day 1 homework';
run;
----------------------------------------

here is the data:
subject  surv  censht  educ  
1           78       1         1
2           70       1         0
3           60       0         1
4           50       1         1
5           90       0         1
.            .         .          .
.            .         .          .
.            .         .          .
100        50       1         0
--------------------------------

In the dataset, 'subject' is suject ID, 'surv' is the survival time,
'censht' is the indicator of censor, 'educ' is the strata variable
indicating the education status.

How convert such SAS codes to R code?

thank you very much,

karena



--
View this message in context: http://r.789695.n4.nabble.com/Convert-SAS-code-to-R-code-about-survival-analysis-tp3594657p3594657.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list