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

Paul Hiemstra paul.hiemstra at knmi.nl
Tue Jun 14 09:59:14 CEST 2011


 Dear Karena,

Your title in the SAS analysis suggests this is homework related to some
course. If this is true, please refer to your tutor for these kinds of
questions, this mailing is list is not meant for these kinds of
questions [1]. For survival analysis in R, the CRAN task view for that
topic is a good place to start [2].

regards,
Paul

[1] http://www.R-project.org/posting-guide.html
[2] http://cran.r-project.org/web/views/Survival.html

On 06/13/2011 07:39 PM, karena wrote:
> 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.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.


-- 
Paul Hiemstra, Ph.D.
Global Climate Division
Royal Netherlands Meteorological Institute (KNMI)
Wilhelminalaan 10 | 3732 GK | De Bilt | Kamer B 3.39
P.O. Box 201 | 3730 AE | De Bilt
tel: +31 30 2206 494

http://intamap.geo.uu.nl/~paul
http://nl.linkedin.com/pub/paul-hiemstra/20/30b/770



More information about the R-help mailing list