marginal_gof_scr: Marginal survival function goodness of fit

View source: R/goodness_of_fit_SurvSurv.R

marginal_gof_scrR Documentation

Marginal survival function goodness of fit

Description

The marginal_gof_scr() function plots the estimated marginal survival functions for the fitted model. This results in four plots of survival functions, one for each of S_0, S_1, T_0, T_1.

Usage

marginal_gof_scr(fitted_model, data, grid, time_unit = "years")

Arguments

fitted_model

Returned value from fit_model_SurvSurv(). This object essentially contains the estimated identifiable part of the joint distribution for the potential outcomes.

data

data that was supplied to fit_model_SurvSurv().

grid

grid of time-points for which to compute the estimated survival functions.

time_unit

character vector that reflects the time unit of the endpoints, defaults to "years".

Examples

library(Surrogate)
data("Ovarian")
#For simplicity, data is not recoded to semi-competing risks format, but is
#left in the composite event format.
data = data.frame(
  Ovarian$Pfs,
  Ovarian$Surv,
  Ovarian$Treat,
  Ovarian$PfsInd,
  Ovarian$SurvInd
)
ovarian_fitted =
  fit_model_SurvSurv(data = data,
                     copula_family = "clayton",
                     n_knots = 1)
grid = seq(from = 0, to = 2, length.out = 200)
marginal_gof_scr(ovarian_fitted, data, grid)


Surrogate documentation built on Sept. 25, 2023, 5:07 p.m.