calc.cure.quantile: Compute the time to statistical cure using the conditional...

View source: R/calc.cure.quantile.R

calc.cure.quantileR Documentation

Compute the time to statistical cure using the conditional probability of cure

Description

The following function estimates the time to statistical cure using the conditional probability of cure.

Usage

calc.cure.quantile(
  fit,
  q = 0.05,
  newdata = NULL,
  max.time = 20,
  var.type = c("ci", "n"),
  reverse = TRUE,
  bdr.knot = NULL
)

Arguments

fit

Fitted model to do predictions from. Possible classes are gfcm, cm, and stpm2.

q

Threshold to estimate statistical cure according to.

newdata

Data frame from which to compute predictions. If empty, predictions are made on the the data which the model was fitted on.

max.time

Upper boundary of the interval [0, max.time] in which to search for solution (see details). Default is 20.

var.type

Character. Possible values are "ci" (default) for confidence intervals, "se" for standard errors, and "n" for neither.

reverse

Logical. Whether to use the conditional probability of not being cured (default) or the conditional probability of cure.

bdr.knot

Time point from which cure is assumed. Only relevant for class stpm2.

Details

The cure point is calculated as the time point at which the conditional probability of disease-related death reaches the threshold, q. If q is not reached within max.time, no solution is reported.

Value

The estimated cure point.

Examples

##Use data cleaned version of the colon cancer data from the rstpm2 package
data("colonDC")
set.seed(2)
colonDC <- colonDC[sample(1:nrow(colonDC), 1000), ]

##Extract general population hazards
colonDC$bhaz <- general.haz(time = "FU", rmap = list(age = "agedays", sex = "sex", year= "dx"),
                            data = colonDC, ratetable = survexp.dk)

#Fit cure model and estimate cure point
fit <- GenFlexCureModel(Surv(FUyear, status) ~ 1, data = colonDC,
                        df = 5, bhazard = "bhaz")
calc.cure.quantile(fit, q = 0.05)

LasseHjort/cuRe documentation built on July 6, 2023, 1:08 p.m.