survivalVis: Create a interactive plot of a cox proportional hazards model

Description Usage Arguments Note Examples

Description

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.

Usage

1
2
survivalVis(cobj, data, group = NULL, group.names = "",
  line.col = "deepskyblue", plot.title = "Survival Plot", day.max = 1000)

Arguments

cobj

An object created with a call to coxph

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

Note

Interaction terms are not fully supported currently. The figure will plot, but transitions may be inaccurate.

Examples

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"))

prpatil/healthvis documentation built on May 26, 2019, 10:32 a.m.