predictEnrollment {eventPred}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 = 30,
  pilevel = 0.9,
  nyears = 4,
  nreps = 500,
  showsummary = TRUE,
  showplot = TRUE,
  by_treatment = FALSE,
  ngroups = 1,
  alloc = NULL,
  treatment_label = NULL
)

Arguments

df

The subject-level enrollment data, including trialsdt, randdt and cutoffdt. The data should also include treatment coded as 1, 2, and so on, and treatment_description for prediction by treatment group. By default, it is set to NULL for enrollment prediction at the design stage.

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 30.

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.

showsummary

A Boolean variable to control whether or not to show the prediction summary. By default, it is set to TRUE.

showplot

A Boolean variable to control whether or not to show the prediction plot. By default, it is set to TRUE.

by_treatment

A Boolean variable to control whether or not to predict enrollment by treatment group. By default, it is set to FALSE.

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 df is not NULL.

alloc

The treatment allocation in a randomization block. By default, it is set to NULL, which yields equal allocation among the treatment groups.

treatment_label

The treatment labels for treatments in a randomization block for design stage prediction. It is replaced with the treatment_description in the observed data if df is not NULL.

Details

The enroll_fit variable can be used for enrollment prediction at the design stage. 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.

Author(s)

Kaifeng Lu, kaifenglu@gmail.com

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

enroll_pred <- predictEnrollment(
  target_n = 300,
  enroll_fit = list(model = "piecewise poisson",
                    theta = log(26/9*seq(1, 9)/30.4375),
                    vtheta = diag(9)*1e-8,
                    accrualTime = seq(0, 8)*30.4375),
  pilevel = 0.90, nreps = 100)


[Package eventPred version 0.2.5 Index]