Re: [R] exact method in coxph

2008-01-17 Thread Terry Therneau
 The help says that the exact method is computationally demanding, but even
 after days the computing it won't finish. Also, if I include a frailty-term,
 the exact method gives me results in no time. Is my setup incorrect?

  Assume that at some particular time point there are k deaths and n subjects 
at 
risk.  The exact partial likelihood calculation for that time point involves an 
average of k choose n terms.  This gets very big very fast.  For instance 20 
events on day x among 100 subjects involves 100!/(20! 80!)  5e20 terms.  I 
stopped ever using the exact likelihood when I realized
- a particular coxph model was taking a long time, so I did a back of 
the envelope approximation and realized that the expected compute time was 
several years
- for all the cases that were small enough to finish, the Efron 
approximation was very close.


  When there are penalized terms such as pspline() or frailty() the code only 
chooses between the Breslow and Efron approximations.  The code should have 
issued an error message when you specified the exact method -- this is an 
oversight that I will fix.  Since the relevant line of code in coxpenal.fit is
if (method=='efron')
your frailty fit was done using the Breslow approximation.

Terry Therneau

__
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.


[R] exact method in coxph

2008-01-16 Thread Julian Wucherpfennig

I'm trying to estimate a cox proportional hazards regression for repeated
events (in gap time) with time varying covariates. The dataset consists of
just around 6000 observations (lines) (110 events).
The (stylized) data look as follows:

unit dur0  dur1  eventn  event  ongoing  x
1 01  0  0 0  32.23
1 12  0  1 1  35.34
1 01  1  0 1  36.12
1 01  1  1 1  45.83
1 12  2  0 0  32.43
1 23  2  0 0  53.63
1 44  2  1 1  45.48
2 01  0  0 0  14.84
2 12  0  1 1  08.63

A complication here is that units can experience repeated events while
previous events are still ongoing. 

I tried the following: cox1 - coxph( Surv( dur0, dur1, event) ~
strata(eventn) + x)
This works fine under the breslow and efron method. However, since I have a
fair number of ties, especially of repeated events while previous events are
still ongoing, the exact method seems advisable.

The help says that the exact method is computationally demanding, but even
after days the computing it won't finish. Also, if I include a frailty-term,
the exact method gives me results in no time. Is my setup incorrect?

Many thanks in advance!


-
Julian Wucherpfennig
PhD Student Political Science
ETH Zurich - Swiss Federal Institute of Technology
-- 
View this message in context: 
http://www.nabble.com/exact-method-in-coxph-tp14883387p14883387.html
Sent from the R help mailing list archive at Nabble.com.

__
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.