marginal_gof_scr_S_plot {Surrogate} | R Documentation |
Goodness-of-fit plot for the marginal survival functions
Description
The marginal_gof_scr_S_plot()
and marginal_gof_scr_T_plot()
functions
plot the estimated marginal survival functions for the surrogate and true
endpoints. In these plots, it is assumed that the copula model has been
fitted for where
is the (composite) surrogate of interest. In these
plots, the model-based survival functions for are
plotted together with the corresponding Kaplan-Meier etimates.
Usage
marginal_gof_scr_S_plot(fitted_model, grid, treated, ...)
marginal_gof_scr_T_plot(fitted_model, grid, treated, ...)
Arguments
fitted_model |
Returned value from |
grid |
Grid of time-points at which the model-based estimated regression functions, survival functions, or probabilities are evaluated. |
treated |
(numeric) Treatment group. Should be |
... |
Additional arguments to pass to |
Value
NULL
True Endpoint
The marginal goodness-of-fit plots for the true endpoint, build by
marginal_gof_scr_T_plot()
, is simply a comparison of the model-based
estimate of with the Kaplan-Meier (KM) estimate obtained
with
survival::survfit()
. A pointwise 95% confidence interval for the KM
estimate is also plotted.
Surrogate Endpoint
The model-based estimate of follows indirectly from the
fitted copula model because the copula model has been fitted for
instead of
. However, the model-based estimate
still follows easily from the copula model as follows,
The marginal_gof_scr_T_plot()
function plots the model-based estimate for
together with the KM estimate (see above).
Examples
# Load Ovarian data
data("Ovarian")
# Recode the Ovarian data in the semi-competing risks format.
data_scr = data.frame(
ttp = Ovarian$Pfs,
os = Ovarian$Surv,
treat = Ovarian$Treat,
ttp_ind = ifelse(
Ovarian$Pfs == Ovarian$Surv &
Ovarian$SurvInd == 1,
0,
Ovarian$PfsInd
),
os_ind = Ovarian$SurvInd
)
# Fit copula model.
fitted_model = fit_model_SurvSurv(data = data_scr,
copula_family = "clayton",
n_knots = 1)
# Define grid for GoF plots.
grid = seq(from = 1e-3,
to = 2.5,
length.out = 30)
# Assess marginal goodness-of-fit in the control group.
marginal_gof_scr_S_plot(fitted_model, grid = grid, treated = 0)
marginal_gof_scr_T_plot(fitted_model, grid = grid, treated = 0)
# Assess goodness-of-fit of the association structure, i.e., the copula.
prob_dying_without_progression_plot(fitted_model, grid = grid, treated = 0)
mean_S_before_T_plot_scr(fitted_model, grid = grid, treated = 0)