kmplt_svrl {RCASPAR} | R Documentation |
This function can plot the KM curves estimated for $2-3$ patients simultaneously for sake of easier comparison.
kmplt_svrl(all, long, short, title)
all |
Data for the first set of patients; usually the complete set of patients, but could be any other.It is a data frame containing at least the two columns “censored” and “True_STs”. Where “censored” contains the censorship status of the subject as either “0/F” for uncensored subjects or “1/T” for censored subjects. This information is essential to be able to plot the KM curve. |
long |
Data for the second set of patients; in our case the group of patients who survived at least up to the cut off value passed to the predictor. It has essentially the same structure as “all” |
short |
Data for the third and last set of patients; in our case the group of patients who survived less than the cut off value passed on to the predictor. It essentially has the same structure as the two other arguments. |
title |
The main title for the plot. |
This function essentially is the same as kmplt
but does the same for up to $3$ plots simultaneously.
A plot with all $2-3$ KM curves.
Douaa Mugahid
http://www.bmj.com/statsbk/12.dtl
censored <- c(1, 0, 1, 1, 1, 0, 1, 0, 0, 0) True_STs <- c(1, 4, 5, 4, 6, 3, 2, 1, 3, 4) dat1 <- as.data.frame(cbind(True_STs, censored)) censored <- c(1, 0, 1, 0, 1, 0, 1, 0, 1, 1) True_STs <- c(7, 7, 8, 5, 9, 11, 8, 11, 10, 6) dat2 <- as.data.frame(cbind(True_STs, censored)) censored <- c(1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1) True_STs <- c(1, 4, 5, 4, 6, 3, 2, 1, 3, 4, 7, 7, 8, 5, 9, 11, 8, 11, 10, 6) dat3 <- as.data.frame(cbind(True_STs, censored)) kmplt_svrl(all=dat3, long=dat2, short=dat1, title="KM of predictions")