plotCure {MDCcure} | R Documentation |
Plot Cure Probability: A Comparison of Nonparametric and Parametric Estimation
Description
This function generates a plot comparing nonparametric and parametric estimations of cure probability in a univariate setting. The nonparametric estimate is displayed with 95% confidence bands, while the parametric estimate is based on a logit, probit or complementary log-log link. An optional covariate density curve can be added as a secondary axis.
Usage
plotCure(
x,
time,
delta,
main.title = NULL,
title.x = NULL,
model = "logit",
theta = NULL,
legend.pos = "bottom",
density = TRUE,
hsmooth = 10,
npoints = 100
)
Arguments
x |
A numeric vector containing the covariate values. |
time |
A numeric vector representing the observed survival times. |
delta |
A binary vector indicating the event status (1 = event, 0 = censored). |
main.title |
Character string for the main title of the plot. If |
title.x |
Character string for the x-axis label. If |
model |
A character string indicating the assumed model. Options include |
theta |
A numeric vector of length 2, specifying the coefficients for the logistic model to generate the parametric estimate. |
legend.pos |
A character string indicating the position of the legend. Options include |
density |
Logical; if |
hsmooth |
Numeric. Smoothing bandwidth parameter (h) for the cure probability estimator. |
npoints |
Integer. Number of points at which the estimator is evaluated over the covariate range. |
Details
The function estimates the cure probability nonparametrically using the probcure
function
and overlays it with a parametric estimate obtained from a logistic regression model.
Confidence intervals (95%) are included for the nonparametric estimate. Optionally,
the density of the covariate can be shown as a shaded area with a secondary y-axis.
Value
A ggplot object representing the cure probability plot.