fitDropout {eventPred} | R Documentation |
Fit time-to-dropout model
Description
Fits a specified time-to-dropout model to the dropout data.
Usage
fitDropout(
df,
dropout_model = "exponential",
piecewiseDropoutTime = 0,
k_dropout = 0,
scale_dropout = "hazard",
showplot = TRUE,
by_treatment = FALSE,
covariates = NULL
)
Arguments
df |
The subject-level dropout data, including |
dropout_model |
The dropout model used to analyze the dropout data
which can be set to one of the following options:
"exponential", "Weibull", "log-logistic", "log-normal",
"piecewise exponential", "model averaging", or "spline".
The model averaging uses the |
piecewiseDropoutTime |
A vector that specifies the time intervals for the piecewise exponential dropout distribution. 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_dropout |
The number of inner knots of the spline. The default
|
scale_dropout |
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. |
showplot |
A Boolean variable to control whether or not to
show the fitted time-to-dropout survival curve. By default, it is
set to |
by_treatment |
A Boolean variable to control whether or not to
fit the time-to-dropout data by treatment group. By default,
it is set to |
covariates |
The names of baseline covariates from the input data frame to include in the dropout model, e.g., c("age", "sex"). Factor variables need to be declared in the input data frame. |
Value
A list of results from the model fit including key information
such as the dropout model, model
, the estimated model parameters,
theta
, the covariance matrix, vtheta
, as well as the
Akaike Information Criterion, aic
, and
Bayesian Information Criterion, bic
.
If the piecewise exponential model is used, the location
of knots used in the model, piecewiseDropoutTime
, 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 dropout 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-dropout survival curve is also returned.
Author(s)
Kaifeng Lu, kaifenglu@gmail.com
References
Patrick Royston and Mahesh K. B. Parmar. Flexible parametric proportional-hazards and proportional-odds models for censored survival data, with application to prognostic modelling and estimation of treatment effects. Stat in Med. 2002; 21:2175-2197.
Examples
dropout_fit <- fitDropout(df = interimData2,
dropout_model = "exponential")