fitEnrollment {EventPredInCure}R Documentation

Fit enrollment model

Description

Fits a specified enrollment model to the enrollment data.

Usage

fitEnrollment(
  df,
  enroll_model = "b-spline",
  nknots = 0,
  accrualTime = 0,
  criterion = "both"
)

Arguments

df

The subject-level enrollment data, including trialsdt, randdt and cutoffdt.

enroll_model

The enrollment model which can be specified as "Poisson", "Time-decay", "B-spline", or "Piecewise Poisson". 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.

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.

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.

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.

Value

A list of results from the model fit including key information such as the enrollment model, model, the estimated model parameters, theta, the covariance matrix, vtheta, and the Bayesian Information Criterion, bic, and Akaike Information Criterion, aic, as well as the design matrix x for the B-spline enrollment model, and accrualTime for the piecewise Poisson enrollment model.

The fitted enrollment curve is also returned.

References

Examples


enroll_fit <- fitEnrollment(df = interimData1, enroll_model = "b-spline",
                            nknots = 1)


[Package EventPredInCure version 1.0 Index]