Skip to content

Doing a Cox-Regression in R and SPSS

3 messages · Brian Ripley, Bernd Weiss

#
A.S.: I am sorry for sending my first mail to <r-help at R-
project.org>. 
---------------------------------------------------------

Hallo, 

computing a Cox proportional hazards model in SPSS 9.0 and 
R 1.2.2 produces different results for beta-coefficient. 

I use the follwing data set (source: example in  
help(coxph), somewhat modified) 

Time	Status	Covariate (x) 
------------------------- 
4,00	1,00	,00 
3,00	1,00	1,00 
1,00	1,00	1,00 
1,00	,00		1,00 
2,00	1,00	1,00 
2,00	1,00	,00 
3,00	,00		,00 


The results in SPSS: 
-------------------- 
beta		= 1,44 
exp(beta)	= 4,20 
SE			= 1,17 

SPSS Syntax: 
-------------------- 
COXREG 
  t  /STATUS=s(1) 
  /METHOD=ENTER x 
  /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) . 


The results in R: 
-------------------- 
beta		= 1.46 
exp(beta)	= 4,32 
SE			= 1,17 

R Syntax: 
-------------------- 
test1 <- list(time=  c(4, 3,1,1,2,2,3), 
                status=c(1,1,1,0,1,1,0), 
                x=     c(0, 1,1,1,1,0,0), 
summary(coxph( Surv(time, status) ~ x, test1)) 


BTW: The results of SPSS and TDA (Transition Data Analysis) 
 correspondent exactly. 

What went wrong? I strongly suppose, I did some mistakes,  
but I can't image what kind of mistakes. Any ideas? 

Thanks in advance 

Bernd 



--
Bernd Wei? (bernd.weiss at epost.de)
PGP Key ID: 0x4117206F
PGP FP: 08B2 09CD 7192 526D 93FD  2070 53DB 7C4F 4117 206F
www.pgpi.org
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Sun, 11 Mar 2001, Bernd Weiss wrote:

            
Your data have ties in the times. The original theory for Cox models
applies to continuous hazard distributions, for which there can be no ties.
There are various fixes, controlled by the argument of coxph:

  method: a character string specifying the method for tie handling.
          If there  are no tied death times all the methods are
          equivalent. Nearly all Cox regression programs use the
          Breslow method by default, but not this one. The Efron
          approximation is used as the default here, as it is much more
          accurate when dealing with tied death times, and is as
          efficient computationally. The exact method computes the
          exact partial likelihood, which is equivalent to a
          conditional logistic model.  If there are a large number of
          ties the computational time will be excessive.

I think that para (from ?coxph) tells you all you need to know,
except that `accurate' means by reference to the `exact' method.

[...]
#
On 11 Mar 2001, at 7:51, Prof Brian D Ripley wrote:

            
[...]
[...]

<coxph(Surv(t,s)~x, method="breslow", data=coxdata)> works 
fine. 

Thanks for your help.

Bernd


--
Bernd Wei? (bernd.weiss at epost.de)
PGP Key ID: 0x4117206F
PGP FP: 08B2 09CD 7192 526D 93FD  2070 53DB 7C4F 4117 206F
www.pgpi.org
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._