[R] discrepancies between stata and r for a cox regression

Michel Boutsen mboutsen at ulb.ac.be
Mon May 18 15:07:13 CEST 2009


Hello


I would like to develop the use of R.
Trying R and more particulary the cox model, I am surprised by discrepancies between results with stata and R for a cox model

With the same data base, I get a hazard ratio (4.82) that is not the same obtained with stata (4.52)

You will find attached the file leukemia.dta I used (Stata)

Here are the codes for R

library(foreign)
leukemia<-read.dta("leukemia.dta")
library(survival)
res <- coxph(Surv(TIME, STATUS)~TREAT, data=leukemia)
summary(res)


and here the codes for for stata

use "leukemia.dta",clear
stset TIME, failure(STATUS==1)
stcox TREAT

SPSS and EPIinfo give the same HR than Stata

I tried with an other database without any problem

What would be the problem??? I changed of pc and versions of R (2.81 & 2.9.0) without any change. The means are the same for the two packages.

I saw a few posts with discrepancies but with no explanations

Thanks in advance

Michel Boutsen
Brussel's University
Department of Biostatistics 
 
 


More information about the R-help mailing list