David Winsemius
On Mar 14, 2009, at 4:14 AM, Bob Green wrote:
>
> Hello ,
>
> I am hoping for some advice regarding obtaining the values for the
> hazard function in a cox regression that I have undertaken. I have a
> model in the following form, analysed with the package survival (v.
> 2.34-1) and a log-log plot obtained using Design (v. 2.1-2).
>
> For two variables, the lines in the survival curves crossed. The
> statistician I been obtaining advice from (who does not use R) asked
> me to obtain the hazard function values. I am wanting to confirm
> whether basehaz is the correct command to obtain such values, to
> better understand what is occurring in the log plots.
>
> Below is the code that I have been using. Any assistance is
> appreciated,
>
> regards
>
> Bob
>
>
>
> library(survival)
> recidivismv <- read.csv("g://Chapsurv_v.csv",header=T)
> cox.V <- coxph(Surv(intDaysUntilFVPO, Event_v) ~ intAgeAtMHCIndex +
> PRE + group + MHC + strGender, data = recidivismv)
> summary (cox.V)
>
>
> # produces a log-log plot
>
> mvfit <- survfit (Surv(recidivismv$intDaysUntilFVPO, recidivismv
> $Event_v) ~ MHC, data = recidivismv)
> neg.ll <- function(mvfit) -log(-log(mvfit))
> library (Design)
> survplot(mvfit, fun = neg.ll, conf = "none", logt=TRUE)
>
> # hazard values
> mhc2 <- coxph (Surv(recidivismv$intDaysUntilFVPO, recidivismv
> $Event_v) ~ MHC, data = recidivismv)
> basehaz(mhc2)
>
> ______________________________________________
> R-help at 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.
David Winsemius, MD
Heritage Laboratories
West Hartford, CT