Plot.surv.year.annotate | R Documentation |
A function that returns a plot (or a list including the Absolute Change in Survival trend measures and the plot) for average change in cumulative survival by diagnosis year using ggplot. The annotation feature is available for nJP<=3 and the number of multiple intervals selected <=3.
Plot.surv.year.annotate(plotdata, fit, nJP, yearvar,
obscumvar = "Relative_Survival_Cum",
predcumvar = "Predicted_Survival_Cum",
interval = "Interval", annotation = 0,
trend = 0, title = NULL)
plotdata |
The graph data returned by function download.data with downloadtype="graph". |
fit |
The joinpoint object containing the model output. |
nJP |
The number of joinpoints in the model. |
yearvar |
The variable name for year of diagnosis used in argument 'year' of the function joinpoint. |
obscumvar |
The variable name for observed relative cumulative survival. The default is "Relative_Survival_Cum" for relative survival data. For cause-specific data, it needs to be changed accordingly. |
predcumvar |
The variable name for predicted cumulative survival. The default is "Predicted_Survival_Cum". |
interval |
The variable name for year since diagnosis. The default is 'Interval'. |
annotation |
The indicator for the annotation feature. The default is 0 (no annotation on the plot).Two plots with and without annotations will be returned in a list when annotation=1. |
trend |
The indicator for returning the Absolute Change in Survival trend measure tables. The default is 0 (no trend tables returned). |
title |
The title used for the plot. If title=NULL, the default title "Relative Survival by Diagonosis Year" or "Cause-Specific Survival by Diagnosis Year" will be used according to the input data type. |
The returned object is a list and depends on the values for trend
and annotation
.
The list will contain some or all of the names plot_anno
, plot_no_anno
, and trends
,
where plot_anno
is an object of class ggplot
for a plot with annotations,
plot_no_anno
is an object of class ggplot
for a plot without annotations, and
trends
is a list of data frames for the change in hazard trend measures with columns
start.year
, end.year
, estimate
, std.error
,
lowCI
, upCI
, and interval
.
Fanni Zhang <zhangf@imsweb.com>
download.data
, Plot.dying.year.annotate
,
Plot.surv.int.multiyears
,aapc.multiints
.
data("breast.example", package="JPSurv")
data("fit3", package="JPSurv")
yearvar<-"Year_of_diagnosis_1975"
obscumvar<-"Relative_Survival_Cum"
predcumvar<-"Predicted_Survival_Cum"
interval<-"Interval"
nJP<-2
data.graph<-download.data(breast.example,fit3,nJP,yearvar,"graph",
subsetStr3,interval,int.select=c(1,5))
out<-Plot.surv.year.annotate(data.graph,fit3,nJP,yearvar,obscumvar,
predcumvar,interval,annotation=0,trend=0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.