plot.bsplines {xhaz} | R Documentation |
plot.bsplines
Description
to plot the log hazard ratio functions for non-proportional hazards model
Usage
## S3 method for class 'bsplines'
plot(
x,
cov,
conf.int = TRUE,
baseline = FALSE,
xrange,
yrange,
xlegend,
ylegend,
glegend,
xaxs = NULL,
add = FALSE,
col = 1,
lty = 1,
lwd = 1,
...
)
Arguments
x |
An object of class xhaz |
cov |
specify covariates for which a plot is required. |
conf.int |
a vector of logical values indicating whether (if TRUE) confidence intervals will be plotted. The default is to do so if the plot concerns only one curve. |
baseline |
a vector of logical values indicating whether (if |
xrange |
vector indicating the minimum and the maximum values of the x axis. By default, these values are automatically calculated for the first plot (i.e before the use of add argument). |
yrange |
vector indicating the minimum and the maximum values of the y axis. By default, these values are automatically calculated for the first plot (i.e before the use of add argument). |
xlegend |
value indicating the location of the legend over x axis. By default, location at the left of the plot. |
ylegend |
value indicating the location of the legend over y axis. By default, location at the top of the plot |
glegend |
vectors of names attributed to each lines of the excess hazard
to be displayed in the plot. If ( |
xaxs |
the x axis style, as listed in 'par'. Survival curves are traditionally drawn with the curve touching the bounding box on the left edge, but not touching it on the right edge. This corresponds to neither of the two standard S axis styles of "e" (neither touches) or "i" (both touch). If xaxis is missing or NULL the internal axis style is used (xaxs= i) but only after the right endpoint has been extended. |
add |
a logical value indicating whether to add the survival curves to the
current plot (if |
col |
a vector of integers specifying colors for each curve. The default value is 1. |
lty |
a vector of integers specifying line types for each curve. The
default value is fixed by the number of covariates (plus 1 if |
lwd |
a vector of numeric values for line widths. The default value is 1. |
... |
additional arguments affecting the plot function |
Value
The return of this function produce graphics of log hazard ratio functions for non-proportional hazards model
Author(s)
Juste Goungounga, Robert Darlin Mba, Nathalie Graff\'eo and Roch Giorgi
References
Goungounga JA, Touraine C, Graff\'eo N, Giorgi R; CENSUR working survival group. Correcting for misclassification and selection effects in estimating net survival in clinical trials. BMC Med Res Methodol. 2019 May 16;19(1):104. doi: 10.1186/s12874-019-0747-3. PMID: 31096911; PMCID: PMC6524224. (PubMed)
Touraine C, Graff\'eo N, Giorgi R; CENSUR working survival group. More accurate cancer-related excess mortality through correcting background mortality for extra variables. Stat Methods Med Res. 2020 Jan;29(1):122-136. doi: 10.1177/0962280218823234. Epub 2019 Jan 23. PMID: 30674229. (PubMed)
Mba RD, Goungounga JA, Graff\'eo N, Giorgi R; CENSUR working survival group. Correcting inaccurate background mortality in excess hazard models through breakpoints. BMC Med Res Methodol. 2020 Oct 29;20(1):268. doi: 10.1186/s12874-020-01139-z. PMID: 33121436; PMCID: PMC7596976. (PubMed)
Giorgi R, Abrahamowicz M, Quantin C, Bolard P, Esteve J, Gouvernet J, Faivre J. A relative survival regression model using B-spline functions to model non-proportional hazards. Statistics in Medicine 2003; 22: 2767-84. (PubMed)
Examples
# load the data set in the package
library("xhaz")
library("survexp.fr")
data("dataCancer", package = "xhaz") # load the data set in the package
fit.nphBS <- xhaz(
formula = Surv(obs_time_year, event) ~ ageCentre + qbs(immuno_trt),
data = dataCancer,
ratetable = survexp.fr,
interval = c(0, NA, NA, max(dataCancer$obs_time_year)),
rmap = list(age = 'age', sex = 'sexx', year = 'year_date'),
baseline = "bsplines", pophaz = "classic")
plot(fit.nphBS, cov = "immuno_trt", col = "blue", baseline = FALSE)