calc.Crude {cuRe} | R Documentation |
Crude event probabilities
Description
Function for computing crude event probabilties based on relative survival models.
Usage
calc.Crude(
object,
newdata = NULL,
type = c("disease", "other", "condother"),
time = NULL,
tau = 100,
reverse = FALSE,
var.type = c("ci", "se", "n"),
exp.fun = NULL,
ratetable = cuRe::survexp.dk,
rmap,
scale = ayear,
smooth.exp = FALSE,
pars = NULL,
link = "loglog",
n = 100
)
Arguments
object |
Fitted model to do predictions from. Possible classes are
|
newdata |
Data frame from which to compute predictions. If empty, predictions are made on the the data which the model was fitted on. |
type |
Probability to compute. Possible values are |
time |
Time points at which to compute predictions. If empty, a grid of 100 time points between 0
and |
tau |
Upper bound of the integral used to compute the probability of disease-related death (see details).
The argument is only used for |
reverse |
Logical. If |
var.type |
Character. Possible values are " |
exp.fun |
Object of class |
ratetable |
Object of class |
rmap |
List to be passed to |
scale |
Numeric. Passed to the |
smooth.exp |
Logical. If |
pars |
A vector of parameter values for the model given in |
link |
Link function for computing variance in order to restrict confidence intervals to [0, 1].
Default is |
n |
Number of knots used for the Gauss-Legendre quadrature. |
Details
The function estimates crude probabilities by using the relative survival, expected survival,
and the cause-specific hazard function.
The crude cumulative incidence of disease-related death (type = "disease"
) is
P(T \leq t, D = disease) = \int_0^t S^*(u) R(u) \lambda(u)du.
The crude cumulative incidence of death from other causes (type = "other"
) is
P(T \leq t, D = other) = \int_0^t S^*(u) R(u) h^*(u)du.
The conditional probability of eventually dying from other causes than disease (type = "condother"
) is
P(D = other| T > t) = \frac{P(D = disease) - P(T \leq t, D = disease)}{P(T > t)}.
The probability of disease-related death, P(D = disease),
can be computed by using type = "disease"
and choosing a sufficiently large time point.
For P(D = other| T>t), the argument tau
controls this time point (default is 100).
Value
A list containing the crude probability estimates
of each individual in newdata
.
Examples
##Use data cleaned version of the colon disease 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)
##Spline-base cure model
#Fit cure model
fit <- rstpm2::stpm2(Surv(FUyear, status) ~ 1, data = colonDC, df = 6,
bhazard = colonDC$bhaz, cure = TRUE)
#Compute the probability of disease-related death
res <- calc.Crude(fit, time = seq(0, 20, length.out = 50),
rmap = list(age = agedays, sex = sex, year = dx),
var.type = "n")
plot(res)
#Compute the conditional probability of dying from other causes than disease
res <- calc.Crude(fit, time = seq(0, 20, length.out = 50), type = "condother",
rmap = list(age = agedays, sex = sex, year = dx), var.type = "n")
plot(res)
#Simple parametric cure model
#Fit cure model
fit <- fit.cure.model(Surv(FUyear, status) ~ 1, data = colonDC, bhazard = "bhaz",
type = "mixture", dist = "weibull", link = "logit")
#Compute the probability of disease-related death
res <- calc.Crude(fit, time = seq(0, 20, length.out = 50),
rmap = list(age = agedays, sex = sex, year = dx),
var.type = "n")
plot(res)
#Compute the conditional probability of disease-related death
res2 <- calc.Crude(fit, time = seq(0, 20, length.out = 50), type = "condother",
rmap = list(age = agedays, sex = sex, year = dx), reverse = TRUE,
var.type = "n")
plot(res2)