fitEvent {EventPredInCure} | R Documentation |
Fit time-to-event model
Description
Fits a specified time-to-event model to the event data.
Usage
fitEvent(
df,
event_model = "model averaging",
piecewiseSurvivalTime = 0,
k = 0,
scale = "hazard",
by_treatment = FALSE,
criterion = "both"
)
Arguments
df |
The subject-level event data, including |
event_model |
The event model used to analyze the event data
which can be set to one of the following options:
"exponential", "Weibull", "log-logistic", "log-normal",
"piecewise exponential", "model averaging", "spline","exponential with cured population","weibull with cured population",
"log-normal with cured population","log-logistic with cured population" or "piecewise exponential with cured population".
The model averaging uses the |
piecewiseSurvivalTime |
A vector that specifies the time intervals for the piecewise exponential survival distribution or piecewise exponential with cured population. Must start with 0, e.g., c(0, 60) breaks the time axis into 2 event intervals: [0, 60) and [60, Inf). By default, it is set to 0. |
k |
The number of inner knots of the spline. The default
|
scale |
If "hazard", the log cumulative hazard is modeled as a spline function. If "odds", the log cumulative odds is modeled as a spline function. If "normal", -qnorm(S(t)) is modeled as a spline function. |
by_treatment |
A Boolean variable to control whether or not to
fit the time-to-event data by treatment group. By default,
it is set to |
criterion |
A character variable to denote the criterion in model
selection to shown in the figure, which can be set to one of the following
options: "aic","bic" or "both". By default,it is set to |
Value
A list of results from the model fit including key information
such as the event model, model
, the estimated model parameters,
theta
, the covariance matrix, vtheta
, as well as the
Bayesian Information Criterion, bic
, and Akaike Information Criterion, aic
.
If the piecewise exponential model is used, the location
of knots used in the model, piecewiseSurvivalTime
, will
be included in the list of results.
If the model averaging option is chosen, the weight assigned
to the Weibull component is indicated by the w1
variable.
If the spline option is chosen, the knots
and scale
will be included in the list of results.
When fitting the event model by treatment, the outcome is presented as a list of lists, where each list element corresponds to a specific treatment group.
The fitted time-to-event survival curve is also returned.
References
Royston, Patrick, and Mahesh KB Parmar. "Flexible parametric proportional‐hazards and proportional‐odds models for censored survival data, with application to prognostic modelling and estimation of treatment effects." Statistics in medicine 21.15 (2002): 2175-2197.
Chen, Tai-Tsang. "Predicting analysis times in randomized clinical trials with cancer immunotherapy." BMC medical research methodology 16.1 (2016): 1-10.
Examples
event_fit <- fitEvent(df = interimData2,
event_model = "piecewise exponential",
piecewiseSurvivalTime = c(0, 180))