Linda Lei
2006-Aug-17 00:33 UTC
[R] putting the mark for censored time on 1-KM curve or competing risk curve
Hi All, I'm trying to figure out the cumulative incidence curve in R in some limited time. I found in package "cmprsk", the command "plot.cuminc" can get this curve. But I noticed that there is no mark for the censored time there, comparing with the KM curve by "plot.survfit". Here are my codes (attached is the data): ---------------- dat<-read.table("F://wendy/BMT data analysis/final data.txt",header=TRUE,sep="\t") library(cmprsk) library(survival) attach(dat) par(mfrow=c(2,1)) curve<-cuminc(SURVEFP/365.25,STATREP,Ritux) plot(curve,xlab="years",curvlab=c("No rituximab", "Rituximab"),lty=1:2,col=c("red","blue"),mark.time=TRUE) a<-survfit(Surv(SURVEFP/365.25,STATREP)~Ritux,type="kaplan-meier") plot(a,main="OS for whole group",conf.int=F,xlab="years",ylab="probability",lty=1:2,col=c("red","b lue")) ------------------- Could you help me with how to put the mark for censored time on cumulative incidence curve, or maybe how to get the 1-KM curve with the mark for censored time? This will help me a lot! Thank you very much! -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: final data.txt Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060816/6b2d2754/attachment.txt
Linda Lei
2006-Aug-23 18:49 UTC
[R] putting the mark for censored time on 1-KM curve or competing risk curve
Hi All, I'm trying to figure out the cumulative incidence curve in R in some limited time. I found in package "cmprsk", the command "plot.cuminc" can get this curve. But I noticed that there is no mark for the censored time there, comparing with the KM curve by "plot.survfit". Here are my codes (attached is the data): ---------------- dat<-read.table("F://wendy/BMT data analysis/final data.txt",header=TRUE,sep="\t") library(cmprsk) library(survival) attach(dat) par(mfrow=c(2,1)) curve<-cuminc(SURVEFP/365.25,STATREP,Ritux) plot(curve,xlab="years",curvlab=c("No rituximab", "Rituximab"),lty=1:2,col=c("red","blue"),mark.time=TRUE) a<-survfit(Surv(SURVEFP/365.25,STATREP)~Ritux,type="kaplan-meier") plot(a,main="OS for whole group",conf.int=F,xlab="years",ylab="probability",lty=1:2,col=c("red","b lue")) ------------------- Could you help me with how to put the mark for censored time on cumulative incidence curve, or maybe how to get the 1-KM curve with the mark for censored time? This will help me a lot! Thank you very much! -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: final data.txt Url: https://stat.ethz.ch/pipermail/r-help/attachments/20060823/6e76f3b5/attachment.txt