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 leukemia=read.fwf(file="leukem.txt",widths=c(4,2,3,2,5,2),col.names=c("id","TREAT","TIME","STATUS","LOGWBC", "GENDER")) library(survival) res <- coxph(Surv(TIME, STATUS)~TREAT, data=leukemia) summary(res) and here the codes for for stata infix ID 2-3 TREAT 6 TIME 8-9 STATUS 11 LOGWBC 12-16 GENDER 18 using "g:rleukem.txt",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 not with the same database Thanks in advance Michel Boutsen Brussel's University Department of Biostatistics
1 1 6 1 2.31 0 2 1 6 1 4.06 1 3 1 6 1 3.28 0 4 1 6 0 3.2 0 5 1 7 1 4.43 0 6 1 9 0 2.8 0 7 1 10 1 2.96 0 8 1 10 0 2.7 0 9 1 11 0 2.6 0 10 1 13 1 2.88 0 11 1 16 1 3.6 1 12 1 17 0 2.16 0 13 1 19 0 2.05 0 14 1 20 0 2.01 1 15 1 22 1 2.32 1 16 1 23 1 2.57 1 17 1 25 0 1.78 1 18 1 32 0 2.2 1 19 1 32 0 2.53 1 20 1 34 0 1.47 1 21 1 35 0 1.45 1 22 2 1 1 2.8 1 23 2 1 1 5 1 24 2 2 1 4.91 1 25 2 2 1 4.48 1 26 2 3 1 4.01 1 27 2 4 1 4.36 1 28 2 4 1 2.42 1 29 2 5 1 3.49 1 30 2 5 1 3.97 0 31 2 8 1 3.52 0 32 2 8 1 3.05 0 33 2 8 1 2.32 0 34 2 8 1 3.26 1 35 2 11 1 3.49 0 36 2 11 1 2.12 0 37 2 12 1 1.5 0 38 2 12 1 3.06 0 39 2 15 1 2.3 0 40 2 17 1 2.95 0 41 2 22 1 2.73 0 42 2 23 1 1.97 1
______________________________________________ R-help@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.