getPrediction {EventPredInCure}R Documentation

Enrollment and event prediction

Description

Performs enrollment and event prediction by utilizing observed data and specified enrollment and event models.

Usage

getPrediction(
  df = NULL,
  to_predict = "enrollment and event",
  target_n = NA,
  target_d = NA,
  enroll_model = "b-spline",
  nknots = 0,
  lags = 30,
  accrualTime = 0,
  enroll_prior = NULL,
  event_model = "exponential",
  piecewiseSurvivalTime = 0,
  k = 0,
  scale = "hazard",
  event_prior = NULL,
  dropout_model = "exponential",
  piecewiseDropoutTime = 0,
  dropout_prior = NULL,
  fixedFollowup = FALSE,
  followupTime = 365,
  pilevel = 0.9,
  nyears = 4,
  nreps = 500,
  showEnrollment = TRUE,
  showEvent = TRUE,
  showDropout = FALSE,
  showOngoing = FALSE,
  by_treatment = FALSE,
  ngroups = 1,
  alloc = NULL,
  treatment_label = NULL,
  criterion = "both",
  seed.num = NULL
)

Arguments

df

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

to_predict

Specifies what to predict: "enrollment only", "event only", or "enrollment and event". By default, it is set to "enrollment and event".

target_n

The target number of subjects to enroll in the study.

target_d

The target number of events to reach in the study.

enroll_model

The enrollment model which can be specified as "Poisson", "Time-decay", "B-spline", "Piecewise Poisson" or "Piecewise Uniform". By default, it is set to "B-spline".

nknots

The number of inner knots for the B-spline enrollment model. By default, it is set to 0.

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.

accrualTime

The accrual time intervals for the piecewise Poisson model. Must start with 0, e.g., c(0, 30) breaks the time axis into 2 accrual intervals: [0, 30) and [30, Inf). By default, it is set to 0.

enroll_prior

The prior of enrollment model parameters.

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","exponential with cured population","weibull with cured population", "log-normal with cured population","log-logistic with cured population", or "piecewise exponential with cured population". For the design stage analysis, there are additional options:"exponential with cured population and delayed treatment", "weibull with cured population and delayed treatment", "log-normal with cured population and delayed treatment","log-logistic with cured population and delayed treatment" The model averaging uses the exp(-bic/2) weighting and combines Weibull and log-normal models. By default, it is set to "exponential".

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 event model of Royston and Parmar (2002). The default k=0 gives a Weibull, log-logistic or log-normal model, if scale is "hazard", "odds", or "normal", respectively. The knots are chosen as equally-spaced quantiles of the log uncensored survival times. The boundary knots are chosen as the minimum and maximum log uncensored survival times.

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.

event_prior

The prior of event model parameters.

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", or "piecewise exponential". By default, it is set to "exponential".

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.

dropout_prior

The prior of dropout model parameters.

fixedFollowup

A Boolean variable indicating whether a fixed follow-up design is used. By default, it is set to FALSE for a variable follow-up design.

followupTime

The follow-up time for a fixed follow-up design, in days. By default, it is set to 365.

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.

showEnrollment

A Boolean variable to control whether or not to show the number of enrolled subjects. By default, it is set to TRUE.

showEvent

A Boolean variable to control whether or not to show the number of events. By default, it is set to TRUE.

showDropout

A Boolean variable to control whether or not to show the number of dropouts. By default, it is set to FALSE.

showOngoing

A Boolean variable to control whether or not to show the number of ongoing subjects. By default, it is set to FALSE.

by_treatment

A Boolean variable to control whether or not to predict 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.

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

seed.num

The number of the random seed. The default is NULL.

Details

For the time-decay model, the mean function is mu(t) = mu/delta*(t - 1/delta*(1 - exp(-delta*t))) and the rate function is lambda(t) = mu/delta*(1 - exp(-delta*t)). For the B-spline model, the daily enrollment rate is approximated as lambda(t) = exp(B(t)*theta), where B(t) represents the B-spline basis functions.

The enroll_prior variable should be a list that includes model to specify the enrollment model (poisson, time-decay, piecewise poisson, or piecewise uniform), theta and vtheta to indicate the parameter values and the covariance matrix. One can use a very small value of vtheta to fix the parameter values. For the piecewise Poisson enrollment or piecewise uniform rate model, the list should also include accrualTime. It should be noted that the B-spline model is not appropriate for use as prior.

For event prediction by treatment with prior information, the event_prior variable should be a list with one element per treatment. For each treatment, the element should include model to specify the event (dropout) model (exponential, weibull, log-logistic, log-normal, or piecewise exponential, weibull with cured population,exponential with cured population,log-normal with cured population, log-logistic with cured population,piecewise exponential with cured population, exponential with cured population and delayed treatment,weibull with cured population and delayed treatment, log-normal with cured population and delayed treatment,log-logistic with cured population and delayed treatment), theta and vtheta to indicate the parameter values and the covariance matrix. For the piecewise exponential or piecewise exponential with cured population or piecewise exponential with cured population and delayed treatment event model, the list should also include piecewiseSurvivalTime to indicate the location of knots. It should be noted that the model averaging and spline options are not appropriate for use as prior.

The dropout_prior should be a list with one element per treatment. For each treatment, the element should include w to specify the weight of the treatment in a randomization block, model to specify the dropout model (exponential, weibull, log-logistic, log-normal, or piecewise exponential), theta and vtheta to indicate the parameter values and the covariance matrix. For the piecewise exponential dropout model, the list should also include piecewiseDropoutTime to indicate the location of knots.

If the event prediction is not by treatment while the prior information is given by treatment, then each element of event_prior (dropout_prior) should also include w to specify the weight of the treatment in a randomization block. This method can only be used in the event prior with exponential, weibull, log-logistic, log-normal, or piecewise exponential.

If the prediction is not by treatment and the prior is given for the overall study, then event_prior (dropout_prior) is a flat list with model, theta, and vtheta. For the piecewise exponential event (dropout) model, it should also include piecewiseSurvivalTime (piecewiseDropoutTime) to indicate the location of knots.

For analysis-stage enrollment and event prediction, the enroll_prior, event_prior, and dropout_prior are either set to NULL to use the observed data only, or specify the prior distribution of model parameters to be combined with observed data likelihood for enhanced modeling flexibility.

Value

A list that includes the fits of observed data models, as well as simulated enrollment data for new subjects and simulated event data for ongoing and new subjects.

Examples


fit1 <- list(model = "piecewise uniform",
             theta = -0.58, 
             vtheta=0, accrualTime =0)
             
fit2<-list()
fit2[[1]] <- list(model = "weibull with cured population and delayed treatment", 
                  theta = c(-2.2,0,6.5,0,1), 
                  vtheta = matrix(0,5,5))
fit2[[2]] <- list(model = "weibull with cured population and delayed treatment", 
                 theta = c(-2.2,0,6.5,46,0.65), 
                 vtheta = matrix(0,5,5))

fit3 <- list()

fit3[[1]] <- list(model = "exponential", 
                   theta =log(0.0003), 
                   vtheta=0)
fit3[[2]] <- list(model = "exponential", 
                   theta =log(0.0003), 
                   vtheta=0)
                   
getPrediction(target_n=200,target_d=60,lags=46,enroll_prior=fit1,
              event_prior=fit2,
              dropout_prior=fit3,ngroups=2)                 




[Package EventPredInCure version 1.0 Index]