[R] Confidence Intervals on Hazard Plots

David Winsemius dwinsemius at comcast.net
Fri Sep 5 17:39:54 CEST 2008


On Sep 5, 2008, at 9:20 AM, Alan Cox wrote:

> Hello,  Is it possible to create confidence intervals for hazard  
> rates?  I'm creating two muhaz objects:
>
> haz1 <- muhaz(NumDaysCustomer[cRV=="true"],status[cRV=="true"])
> haz2 <- muhaz(NumDaysCustomer[cRV=="false"],status[cRV=="false"])
>
> and plotting them.
>
> There are many, many more observations in the cohort cRV=="false"  
> than =="true".  And, there are many more observations with lifetimes  
> in the middle of the range than at the ends.  I suspect that this is  
> a common phenomenon.    When I plot the two hazard rate curves, haz1  
> looks very different than haz2, but I'd like to see if it's  
> different enough.  How can I go about creating confidence intervals  
> and plotting them?

?muhaz.object  says that var.min and bias.min could be extracted from  
haz1 and haz2, since you have not changed the default for bw.method.

The default haz.est vector is twice as long as the default var.min  
vector, so you will need to take care to only plot the haz.est values  
only for the the event times, or perhaps you could specify that  
n.est.grid be the same as n.min.grid at the time of creating your  
fits. Not sure if the second method might have any undesirable side- 
effects, however.

-- 
David Winsemius
Heritage Laboratories



More information about the R-help mailing list