Fits a specified enrollment model to the enrollment data.
fitEnrollment(
df,
enroll_model = "b-spline",
nknots = 0,
accrualTime = 0,
showplot = TRUE
)
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
,
the Akaike Information Criterion, aic
, and
the Bayesian Information Criterion, bic
, 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.
The subject-level enrollment data, including trialsdt
,
randdt
and cutoffdt
.
The enrollment model which can be specified as "Poisson", "Time-decay", "B-spline", or "Piecewise Poisson". By default, it is set to "B-spline".
The number of inner knots for the B-spline enrollment model. By default, it is set to 0.
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.
A Boolean variable to control whether or not to
show the fitted enrollment curve. By default, it is set to TRUE
.
Kaifeng Lu, kaifenglu@gmail.com
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 \(\lambda(t) = \exp(B(t)' \theta)\), where \(B(t)\) represents the B-spline basis functions.
Xiaoxi Zhang and Qi Long. Stochastic modeling and prediction for accrual in clinical trials. Stat in Med. 2010; 29:649-658.
enroll_fit <- fitEnrollment(
df = interimData1, enroll_model = "b-spline",
nknots = 1)
Run the code above in your browser using DataLab