R-users--

I am wondering if the cumulative hazard is being correctly computed when 
evaluated using centered=FALSE. In the bazehaz code (from the survival package) 
(below), I think  

H <- H * exp(-bz0)  should be 
H <- H * exp(bz0)

 function (fit, centered = TRUE) 
{
    if (!inherits(fit, "coxph")) 
        stop("must be a coxph object")
    sfit <- survfit(fit)
    H <- -log(sfit$surv)
    strata <- sfit$strata
    if (!is.null(strata)) 
        strata <- rep(names(strata), strata)
    if (!centered) {
        z0 <- fit$means
        bz0 <- sum(z0 * coef(fit))
        H <- H * exp(-bz0)
    }
    if (is.null(strata)) 
        return(data.frame(hazard = H, time = sfit$time))
    else return(data.frame(hazard = H, time = sfit$time, strata = strata))
}

Thanks,
Dan

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

Reply via email to