Description Usage Arguments Note Examples
survivalVis
plots a cox proportional hazards model and uses
the covariate information to update the figure in real time. Users
can specify a grouping covariate to display a group comparison.
1 2 | survivalVis(cobj, data, group = NULL, group.names = "",
line.col = "deepskyblue", plot.title = "Survival Plot", day.max = 1000)
|
cobj |
An object created with a call to |
data |
The dataset used to creat the coxph object. |
group |
The covariate in model by which to group. If NULL, no grouping. |
group.names |
Names of groups to appear on legend. Default empty string for no grouping. |
line.col |
Vector of names of colors to use for each group. Length must equal number of groups. Default single string for no grouping. |
plot.title |
The title of the plot to appear on the HTML page |
Interaction terms are not fully supported currently. The figure will plot, but transitions may be inaccurate.
1 2 3 4 5 6 7 | # Uses the survival package
library(survival)
# Set trt and prior as factors so they are treated as such
veteran$trt <- as.factor(veteran$trt)
veteran$prior <- as.factor(veteran$prior)
cobj <- coxph(Surv(time, status)~trt+age+celltype+prior, data=veteran)
survivalVis(cobj, data=veteran, plot.title="Veteran Survival Data", group="trt", group.names=c("Treatment", "No Treatment"), line.col=c("#E495A5","#39BEB1"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.