Skip to content
Prev 200985 / 398502 Next

How do I specify a partially completed survival analysis model?

On Nov 20, 2009, at 11:07 AM, RWilliam wrote:

            
The problem, arising as a result of not having a dataset against which  
to test my memories of syntactic niceties, is that glm and coxph use  
different methods of supplying offsets. Thereau and Gramsch's book has  
examples, but if you did not have the book you still had alternatives.  
A bit of searching with the terms: coxph Therneau offset;  produced  
lots of hits for the occurrence of offset in warning messages so  
adding -warning to that search then produced a hit to the Google books  
look at T&G's text with a worked example:

 > a$logX2 <- log(a$X2)
 > coxph(Surv(Time,Censor)~X1 + offset(logX2), data= a )
Call:
coxph(formula = Surv(Time, Censor) ~ X1 + offset(logX2), data = a)


      coef exp(coef) se(coef)     z    p
X1 -0.885     0.413     1.43 -0.62 0.54

#Or just:

 > coxph(Surv(Time,Censor)~X1 + offset(log(4.3*X2)), data= a )
David Winsemius, MD
Heritage Laboratories
West Hartford, CT