View source: R/S3_curelps_plot.R
plot.curelps | R Documentation |
The routine takes as input an object of class curelps
and plots
the estimated baseline survival curve, the population survival
curve for a specific covariate profile and a a smooth curve for the cure
probability. Approximate pointwise credible intervals are available.
## S3 method for class 'curelps' plot(x, cred.int = 0.95, curvetype = c("baseline", "population", "probacure"), covar.profile, fit.col = "black", shade.col = "gray75", plot.cred = FALSE, np = 50, show.legend = TRUE, ...)
x |
An object of class |
cred.int |
The level for an approximate pointwise credible interval to be computed for the smooth curves. Default is 0.95. |
curvetype |
The curve to be plotted; |
covar.profile |
A numeric vector of the same length as the number
of covariates in the model. This corresponds to the profile of covariates
for which to compute the population survival function and cure probability
estimates. The order of the covariates in |
fit.col |
The color used for the estimated survival curve. |
shade.col |
The color used for the shading of the credible intervals. |
plot.cred |
Logical. Should the credible intervals be plotted?
Default is |
np |
The number of points used to plot the smooth curves. Default is 50 and allowed values are between 20 and 200. |
show.legend |
Show the legend? Default is TRUE. |
... |
Further arguments to be passed to |
When plot.cred
is FALSE
, the routine omits to compute
the approximate pointwise credible intervals for plotting and hence is
less computationally intensive.
Oswaldo Gressani oswaldo_gressani@hotmail.fr.
curelps
, curelps.object
,
curelps.extract
, print.curelps
.
# Example on phase III clinical trial e1684 on melanoma data data(ecog1684) # Kaplan-Meier curve plot(survfit(Surv(time, status) ~ 1, data = ecog1684), mark.time = TRUE) fit <- curelps(Surv(time, status) ~ lt(age + trt + sex) + st(age + trt + sex), data = ecog1684, K = 20, penorder = 2) fit profile1 <- c(0, 1, 1, 0, 1, 1) # Mean age, trt = IFN, sex = Female. profile2 <- c(0, 0, 1, 0, 0, 1) # Mean age, trt = control, sex = Female. opar <- par(no.readonly = TRUE) par(mfrow = c(1, 2)) plot(fit, curvetype = "probacure", plot.cred = TRUE, ylim = c(0,1), covar.profile = profile1, cred.int = 0.90, main = "Mean age, trt = IFN, sex = Female", cex.main = 0.8, show.legend = FALSE) plot(fit, curvetype = "probacure", plot.cred = TRUE, ylim = c(0,1), covar.profile = profile2, cred.int = 0.90, main = "Mean age, trt = control, sex = Female", cex.main = 0.8, show.legend = FALSE) par(opar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.