search for: plot_km

Displaying 1 result from an estimated 1 matches for "plot_km".

Did you mean: plot_1
2004 Sep 03
1
Printing output on Plot
...p-values from the output of a CPH test onto a Kaplan Meier plot. Can this be done? I only really want the p-values from the CPH test to appear but if this can't be done I am willing to have the entire CPH output. This is what I am currently trying: (it doesn't print the CPH output) plot_KM <- function(field) { library(survival) y = length(levels(factor(field))) field.KM <- survfit(Surv(age_at_death,death)~field) field.CPH <- coxph(Surv(age_at_death,death)~factor(field)) plot(field.KM,mark.time=FALSE,col=2: (y+1),lty=1,main=paste(as.character(substitute(field))," K...