Title: | Flexible Parametric Cure Models |
---|---|
Description: | Flexible parametric mixture and non-mixture cure models for time-to-event data. |
Authors: | Jordan Amdahl [aut, cre] |
Maintainer: | Jordan Amdahl <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.3.1 |
Built: | 2024-11-16 03:50:17 UTC |
Source: | https://github.com/jrdnmdhl/flexsurvcure |
Mixture and non-mixture cure models using flexible base distributions from the flexsurv package.
flexsurvcure( formula, data, weights, bhazard, subset, dist, na.action, link = "logistic", mixture = T, ... )
flexsurvcure( formula, data, weights, bhazard, subset, dist, na.action, link = "logistic", mixture = T, ... )
formula |
A formula expression in conventional R linear modeling
syntax. The response must be a survival object as returned by the
If there are no covariates, specify By default, covariates are placed on the “theta” parameter of the distribution, representing the cure fraction, through a linear model with the selected link function. Covariates can be placed on parameters of the base distribution by using the
name of the parameter as a “function” in the formula. For example, in a
Weibull model, the following expresses the scale parameter in terms of age
and a treatment variable
However, if the names of the ancillary parameters clash with any real
functions that might be used in formulae (such as
|
data |
A data frame in which to find variables supplied in
|
weights |
Optional variable giving case weights. |
bhazard |
Optional variable giving expected hazards for relative survival models. |
subset |
Vector of integers or logicals specifying the subset of the observations to be used in the fit. |
dist |
A string representing one of the built-in distributions of flexsurv.
|
na.action |
a missing-data filter function, applied after any 'subset'
argument has been used. Default is |
link |
A string representing the link function to use for estimation of the cure fraction. Defaults to "logistic", but also supports "loglog", "probit", and "identity". |
mixture |
optional TRUE/FALSE to specify whether a mixture model should be fitted. Defaults to TRUE. |
... |
other arguments to be passed to |
This function works as a wrapper around flexsurvreg
by
dynamically constructing a custom distribution using wrappers to the
pdf and cdf functions.
In a parametric mixture model, it is assumed that there exists a group of individuals who experience no excess mortality, with the proportion of such individuals being given by the cure fraction parameter, and a parametric distribution representing the excess mortality for the remaining individuals.
By contrast, a parametric non-mixture model simply rescales an existing parametric distribution such that the probability of survival asymptotically approaches the cure fraction parameter as time approaches infinity.
flexsurvcure(Surv(rectime,censrec)~group, data=bc, dist="weibull", anc=list(scale=~group)) flexsurvcure(Surv(rectime,censrec)~group, data=bc, dist="lnorm", mixture = FALSE) flexsurvcure(Surv(rectime,censrec)~group, data=bc, dist="weibull", link="loglog")
flexsurvcure(Surv(rectime,censrec)~group, data=bc, dist="weibull", anc=list(scale=~group)) flexsurvcure(Surv(rectime,censrec)~group, data=bc, dist="lnorm", mixture = FALSE) flexsurvcure(Surv(rectime,censrec)~group, data=bc, dist="weibull", link="loglog")
Probability density, distribution, quantile, random generation, hazard cumulative hazard, mean, and restricted mean functions for generic mixture cure models. These distribution functions take as arguments the corresponding functions of the base distribution used.
pmixsurv(pfun, q, theta, ...) hmixsurv(dfun, pfun, x, theta, ...) Hmixsurv(pfun, x, theta, ...) dmixsurv(dfun, pfun, x, theta, ...) qmixsurv(qfun, p, theta, ...) rmixsurv(qfun, n, theta, ...) rmst_mixsurv(pfun, t, theta, ...) mean_mixsurv(pfun, theta, ...)
pmixsurv(pfun, q, theta, ...) hmixsurv(dfun, pfun, x, theta, ...) Hmixsurv(pfun, x, theta, ...) dmixsurv(dfun, pfun, x, theta, ...) qmixsurv(qfun, p, theta, ...) rmixsurv(qfun, n, theta, ...) rmst_mixsurv(pfun, t, theta, ...) mean_mixsurv(pfun, theta, ...)
pfun |
The base distribution's cumulative distribution function. |
theta |
The estimated cure fraction. |
... |
additional parameters to be passed to the pdf or cdf of the base distribution. |
dfun |
The base distribution's probability density function. |
x , q , t
|
Vector of times. |
qfun |
The base distribution's quantile function. |
p |
Vector of probabilities. |
n |
Number of random numbers to simulate. |
dmixsurv
gives the density, pmixsurv
gives the
distribution function, hmixsurv
gives the hazard and
Hmixsurv
gives the cumulative hazard.
qmixsurv
gives the quantile function, which is computed by crude
numerical inversion.
rmixsurv
generates random survival times by using qmixsurv
on a sample of uniform random numbers. Due to the numerical root-finding
involved in qmixsurv
, it is slow compared to typical random number
generation functions.
mean_mixsurv
and rmst_mixsurv
give the mean and restricted
mean survival times, respectively.
Jordan Amdahl <[email protected]>
Probability density, distribution, quantile, random generation, hazard cumulative hazard, mean, and restricted mean functions for generic non-mixture cure models. These distribution functions take as arguments the corresponding functions of the base distribution used.
pnmixsurv(pfun, q, theta, ...) hnmixsurv(dfun, x, theta, ...) Hnmixsurv(pfun, x, theta, ...) dnmixsurv(dfun, pfun, x, theta, ...) qnmixsurv(qfun, p, theta, ...) rnmixsurv(qfun, n, theta, ...) rmst_nmixsurv(pfun, t, theta, ...) mean_nmixsurv(pfun, theta, ...)
pnmixsurv(pfun, q, theta, ...) hnmixsurv(dfun, x, theta, ...) Hnmixsurv(pfun, x, theta, ...) dnmixsurv(dfun, pfun, x, theta, ...) qnmixsurv(qfun, p, theta, ...) rnmixsurv(qfun, n, theta, ...) rmst_nmixsurv(pfun, t, theta, ...) mean_nmixsurv(pfun, theta, ...)
pfun |
The base distribution's cumulative distribution function. |
theta |
The estimated cure fraction. |
... |
Parameters to be passed to the pdf or cdf of the base distribution. |
dfun |
The base distribution's probability density function. |
x , q , t
|
Vector of times. |
qfun |
The base distribution's quantile function. |
p |
Vector of probabilities. |
n |
Number of random numbers to simulate. |
es dnmixsurv pnmixsurv qnmixsurv rnmixsurv hnmixsurv Hnmixsurv mean_nmixsurv rmst_nmixsurv
dnmixsurv
gives the density, pnmixsurv
gives the
distribution function, hnmixsurv
gives the hazard and
Hnmixsurv
gives the cumulative hazard.
qnmixsurv
gives the quantile function, which is computed by crude
numerical inversion.
rnmixsurv
generates random survival times by using qnmixsurv
on a sample of uniform random numbers. Due to the numerical root-finding
involved in qnmixsurv
, it is slow compared to typical random number
generation functions.
mean_nmixsurv
and rmst_nmixsurv
give the mean and restricted
mean survival times, respectively.
Jordan Amdahl <[email protected]>