[R] log-rank test

Frank E Harrell Jr fharrell at virginia.edu
Tue Jan 14 03:46:02 CET 2003


On Mon, 13 Jan 2003 12:06:55 -0800
Ngayee J Law <Ngayee.Law at celeradiagnostics.com> wrote:

> Hello all,
> 
> Is there a function to do log-rank test in R? Thanks!
> 
> - Jacqueline
> 

It's a special case of the Cox model (see coxph in the survival package).  If you want the standard logrank test, see the logrank function in the Hmisc package (it does not handle stratification though).  E.g.

library(Hmisc)
logrank(Surv(d.time,death), treatment)  # assumes treatment coded 1,2

See http://hesweb1.med.virginia.edu/biostat/s/Hmisc.html

-- 
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat




More information about the R-help mailing list