plot.surv.int.multiyears: Figure - Cumulative Survival by Interval

Plot.surv.int.multiyearsR Documentation

Figure - Cumulative Survival by Interval

Description

A function that returns a plot for Cumulative Survival by Interval supporting multiple selected years.

Usage

Plot.surv.int.multiyears(plotdata, fit, nJP, yearvar, 
                         obscumvar = "Relative_Survival_Cum", 
                         predcumvar = "Predicted_Survival_Cum", 
                         interval = "Interval", year.select = NULL)

Arguments

plotdata

Either of the following data set would work. 1) the graph data returned by function download.data with downloadtype="graph" and all intervals needed for int.col. 2) the full data returned by function download.data with downloadtype="full".

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'.

year.select

The year values selected for the plot. The default is NULL.

Value

An object of class ggplot containing the plot.

Author(s)

Fanni Zhang <zhangf@imsweb.com>

See Also

download.data,Plot.dying.year.annotate, Plot.surv.year.annotate.

Examples

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.full<-download.data(breast.example,fit3,nJP,yearvar,"full",
                         subsetStr3,interval="Interval")
plot<-Plot.surv.int.multiyears(data.full,fit3,nJP,yearvar,obscumvar,
                    predcumvar,interval,year.select=c(1985,1990))

JPSurv documentation built on June 8, 2025, 12:11 p.m.