kmPlot | R Documentation |
Specific Kaplan Meier plot
kmPlot(
fit,
model,
colors_v = c("blue", "red"),
labels_v = c(Low = "low", High = "up"),
main_v = "KM Survival",
xlab_v = "Overall Survival",
ylab_v = "Prop. Survival",
max_x,
leg_y = c(med = 1, rec = 0.83, p = 0.7),
fileName_v = NA
)
fit |
"survfit" object created by survfit() function |
model |
"survdiff" object created by survdiff() function |
colors_v |
vector of colors to plot. Must be same length as number of divisions in fit |
labels_v |
named vector of divisions in survival model. Names will be displayed on legend, values must match those of fit/model. |
main_v |
title for plot |
xlab_v |
label for X-axis. Default is "Overall Survival" |
ylab_v |
label for y-axis. Default is "Prop. Survival" |
max_x |
Max x-value from original data that created fit. Used for placing legends |
leg_y |
named vector of legend y-axis placements. Names are 'med', 'p', and 'rec'. Legends will only be printed if they have a leg_y value. |
fileName_v |
path to output file where plot will be printed. If NA, will print to stdout. |
plot to console of Kaplan Meier survival estimate
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.