predictEnrollment {EventPredInCure} | R Documentation |
Predict enrollment
Description
Utilizes a pre-fitted enrollment model to generate enrollment times for new subjects and provide a prediction interval for the expected time to reach the enrollment target.
Usage
predictEnrollment(
df = NULL,
target_n,
enroll_fit,
lags = 1,
pilevel = 0.9,
nyears = 4,
nreps = 500,
by_treatment = FALSE,
ngroups = 1,
alloc = NULL,
treatment_label = NULL,
seed.num = NULL
)
Arguments
df |
The subject-level enrollment data, including |
target_n |
The target number of subjects to enroll in the study. |
enroll_fit |
The pre-fitted enrollment model used to generate predictions. |
lags |
The day lags to compute the average enrollment rate to carry forward for the B-spline enrollment model. By default, it is set to 1. |
pilevel |
The prediction interval level. By default, it is set to 0.90. |
nyears |
The number of years after the data cut for prediction. By default, it is set to 4. |
nreps |
The number of replications for simulation. By default, it is set to 500. |
by_treatment |
A Boolean variable to control whether or not to
predict enrollment by treatment group. By default,
it is set to |
ngroups |
The number of treatment groups for enrollment prediction
at the design stage. By default, it is set to 1.
It is replaced with the actual number of
treatment groups in the observed data if |
alloc |
The treatment allocation in a randomization block.
By default, it is set to |
treatment_label |
The treatment labels for treatments in a randomization block for design stage prediction. |
seed.num |
The number of the random seed. The default is NULL. |
Details
The enroll_fit
variable can be used for enrollment prediction
at the design stage. A piecewise uniform can be parameterized
through the time intervals, accrualTime
, which is
treated as fixed, and the enrollment rates in the intervals,
accrualrate
, the number of patients in each intervals.
A piecewise Poisson model can be parameterized
through the time intervals, accrualTime
, which is
treated as fixed, and the enrollment rates in the intervals,
accrualIntensity
, the log of which is used as the
model parameter. For the homogeneous Poisson, time-decay,
and piecewise Poisson models, enroll_fit
is used to
specify the prior distribution of model parameters, with
a very small variance being used to fix the parameter values.
It should be noted that the B-spline model is not appropriate
for use during the design stage.
During the enrollment stage, enroll_fit
is the enrollment model
fit based on the observed data. The fitted enrollment model is used to
generate enrollment times for new subjects.
Value
A list of prediction results, which includes important information such as the median, lower and upper percentiles for the estimated time to reach the target number of subjects, as well as simulated enrollment data for new subjects. The data for the prediction plot is also included within the list.
References
Xiaoxi Zhang and Qi Long. Stochastic modeling and prediction for accrual in clinical trials. Stat in Med. 2010; 29:649-658.
Examples
# Enrollment prediction at the design stage
fit1 <- list(model = "piecewise uniform",
theta = -0.58,
vtheta=0, accrualTime =0)
predictEnrollment(df = NULL, target_n=200, enroll_fit = fit1,lags=46,
pilevel=0.9, nyears=4, nreps=100,by_treatment=TRUE,
ngroups=2, alloc=c(1,1), treatment_label=c('a','b'))