Skip to content

how to plot hazard function for coxph model?

3 messages · suman kumar, David Winsemius, Suman Pramanik

#
On Jul 26, 2012, at 9:00 AM, suman kumar wrote:

            
I'm thinking this might not be what you want, although it is one  
plausible guess at what you are asking for. You really should say what  
code and data was being used. This uses a built-n dataset in  
Therneau's survival package:

fit <- coxph(Surv(time, status) ~ age + ph.ecog + strata(inst), lung)
plot( predict(fit,
               newdata=data.frame(age=62,
                                  ph.ecog=1,
                                  inst=12,
                                  time=seq(0,1000,by=100),
                 type="lp")) )

(Returns a flat line at 0.17.  Be sure to read predict.coxph carefully.)

David.
#
No, this is not what i wanted.
Plotting of survfit object in therneu's survival package plots
survival/cumulative incidence and cumulative hazard function for a
given fit.
What I wanted to know was that is there a way to plot hazard function of a plot?
I got the reply from Dr Therneu yesterday.  Plotting hazard is just
like plotting density function. muhaz package has got the routines for
doing the same.
Thanks a Lot for replying.
Suman

On 27 July 2012 14:02, David Winsemius [via R]
<ml-node+s789695n4638070h21 at n4.nabble.com> wrote: