As a complement to Mikeβs answer, one could model the number of events by the Poisson distribution instead of the normal distribution. The degree of danger can then be calculated by distributing gamma radiation. The code will look like this:
library(muhaz) library(data.table) library(rGammaGamma) data(ovarian, package="survival") attach(ovarian) fit1 <- muhaz(futime, fustat) plot(fit1) #Function to bootstrap hazard estimates haz.bootstrap <- function(data,trial,min.time,max.time){ library(data.table) data <- as.data.table(data) data <- data[sample(1:nrow(data),nrow(data),replace=T)] fit1 <- muhaz(data$futime, data$fustat,min.time=min.time,max.time=max.time) result <- data.table(est.grid=fit1$est.grid,trial,haz.est=fit1$haz.est) return(result) } #Re-run function to get 1000 estimates haz.list <- lapply(1:1000,function(x) haz.bootstrap(data=ovarian,trial=x,min.time=0,max.time=744)) haz.table <- rbindlist(haz.list,fill=T) #Calculate Mean, gamma parameters, upper and lower 95% confidence bands plot.table <- haz.table[, .(Mean=mean(haz.est), Shape = gammaMME(haz.est)["shape"], Scale = gammaMME(haz.est)["scale"]), by=est.grid] plot.table[, u95 := qgamma(0.95,shape = Shape + 1, scale = Scale)] # The + 1 is due to the discrete character of the poisson distribution. plot.table[, l95 := qgamma(0.05,shape = Shape, scale = Scale)] #Plot graph ggplot(data=plot.table) + geom_line(aes(x=est.grid, y=Mean),col="blue") + geom_ribbon(aes(x=est.grid, y=Mean, ymin=l95, ymax=u95),alpha=0.5, fill= "lightblue")

As can be seen, negative assessments of the lower boundary of the danger rate now disappeared.
Jacco
source share