Title: | Scheduling Interim Analyses in Clinical Trials |
---|---|
Description: | Allows the simulation of the recruitment and both the event and treatment phase of a clinical trial. Based on these simulations, the timing of interim analyses can be assessed. |
Authors: | Bastian Becker, Katharina Mueller, Hermann Kulmann |
Maintainer: | Bastian Becker <[email protected]> |
License: | GPL |
Version: | 0.8.0 |
Built: | 2025-01-30 04:36:36 UTC |
Source: | https://github.com/cran/interim |
It is often discussed during the planning of a clinical trial whether an interim analysis
is beneficial. The time point of the interim analysis and the end of the clinical trial
are crucial for the decision. Both depend on the recruitment of patients and on the length
of the treatment phase. The package interim
allows the instantaneous simulation and
plotting of both the recruitment and treatment phase. Based on these simulations, the
timing of interim analyses can be assessed or different recruitment scenarios
can be compared.
There are three main functions in this package:
The function recruitment
generally is the starting point. It simulates screening
and enrollment based on screening characteristics, like e.g. number of available centers
and patients, screen failure rate, etc.
The function treatment
simulates the treatment period based on a given recruitment
scenario as simulated by recruitment
.
The function trialCourse
plots displays of enrollment and treatment simulations.
Two plots are provided; the first one displays center openings and the second one
displays patient screening, enrollment and treatment.
In addition to the main functions, the package comprises a number of auxilliary functions helping to derive or convert parameters required for the three main functions, as well as to derive and plot information on timing of interim analyses. The following auxilliary functions are available:
Function capacity
calculates the maximum number of enrollments for a recruitment in scenario 4.
capacity(nc, ns, sf)
capacity(nc, ns, sf)
nc |
maximum number of centers to be opened. |
ns |
maximum number of patients to be screened within each center. |
sf |
screening failure rate. |
capacity
is an auxilliary function to determine the maximum number of patients that can be enrolled
in the scenario where only a limited number of centers is available and each center only has a limited number
of patients that can be enrolled.
The maximum number of patients that can be enrolled.
recruitment
for simulating recruitment scenarios
mE=capacity(nc=40,ns=10,sf=0.3) recruitment(nc=40,ns=10,cw=4,sw=2,sf=0.3,tb=4,en=mE)
mE=capacity(nc=40,ns=10,sf=0.3) recruitment(nc=40,ns=10,cw=4,sw=2,sf=0.3,tb=4,en=mE)
Function convertedRate
converts a drop-out rate from one period to another. If the drop-out rate is defined for
w1 weeks convertedRate
yields the drop-out rate for w2 weeks.
convertedRate(r, w1, w2)
convertedRate(r, w1, w2)
r |
rate between 0 and 1 (0 < r < 1) |
w1 |
number of weeks for which r is defined |
w2 |
number of weeks to which the rate shall be converted |
convertedRate
is an auxilliary function that converts drop-out rates for different time periods.
The function can be used in order to convert drop-out rates required for function treatment
. Function
treatment
requires the drop-out rate for the respective treatment duration as input. Typically known annual
drop-out rates can be converted to the respective rate for the treatment duration accordingly by setting w1
to 52 and w2
to the respective treatment duration.
The converted drop-out rate.
treatment
for simulating the treatment duration for a given recruitment scenario
convertedRate(r=0.3,w1=52,w2=26)
convertedRate(r=0.3,w1=52,w2=26)
Function cross
plots two cossing lines into the patients diagram .
cross(w, p)
cross(w, p)
w |
week where the vertical line is plotted. |
p |
number of patients where the horizontal line is plotted. |
This function includes a vertical and horizontal line into an existing patient diagram
produced by function trialCourse
or into an existing event diagram produced by function evenCourse
.
The lines are to mark the timepoint w
in weeks at which a required number of
patients or events p
has finished their treatment or occured as first events, respectivley. The display can be used to assess
the scheduling of interim analyses.
The auxilliary functions trialWeek
or eventWeek
can be used to derive the week of the
trial in which the required number of patients has finished the treatment or events occured.
trialCourse
for plots of recruitment and treatment scenarios;
trialWeek
for deriving the week of a trial at which a certain number of patients finished treatment.
eventCourse
for plots of recruitment and event scenarios;
eventWeek
for deriving the week of a trial at which a certain number of event occured.
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3) trialCourse(r=x,t1=y,t2=z) trialWeek(t=y,p=100) cross(w=trialWeek(t=y,p=100),p=100)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3) trialCourse(r=x,t1=y,t2=z) trialWeek(t=y,p=100) cross(w=trialWeek(t=y,p=100),p=100)
Function event
simulates the events base on a recruitment scenario simulated by function recruitment
.
event(r, er, dr, du)
event(r, er, dr, du)
r |
recruitment scenario calculated with function |
er |
event rate during the clinical trail. |
dr |
drop-out rate during the clinical trail. |
du |
duration of the clinical trail in weeks. |
event
simulates the events based on a given recruitment scenario.
The function assumes an exponential distribution for the event probability with a common event rate for all subjects (er
).
The drop-out rate may be included. For the probability of an drop-out, treatment
assumes an exponential distribution with a common rate dr
.
It is assumed that the even and drop-out time are independent of each other.
event
returns a list of vectors with the following components:
events
a vector with the (cumulative) number of frist events (events before drop-out)
drops
a vector with the (cumulative) number of patients who droped out of the trail before the first event
weeksOfEvent
a vector with the corresponding trial week when patients have experienced the first event
(with start of site openings as reference start)
recruitment
for simulating recruitment scenarios;
eventCourse
for plots of recruitment and event scenarios;
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=event(r=x,er=0.12,dr=0.08,du=50) x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=event(r=x,er=0.12,dr=0.08,du=50)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=event(r=x,er=0.12,dr=0.08,du=50) x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=event(r=x,er=0.12,dr=0.08,du=50)
Function eventCourse
plots the results of function recruitment
and function event
.
eventCourse(r, e1 = NULL, lp = "topright")
eventCourse(r, e1 = NULL, lp = "topright")
r |
recruitment scenario calculated with function |
e1 |
optional. Event simulation from function |
lp |
optional. Position of legend, specified by keyword: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", or "center". |
Function eventCourse
produces two plots to display results of enrollment
and treatment simulations.
The first plot displays the cumulative number of centers that have been opened as well as the cumulative number of centers that have been closed, if applicable, per trial week.
The second plot displays the number of patients that have been screened and enrolled per trial week.
If the parameter e1
is not NULL
, then
the number of events and the number of drop-outs before first event ist displayed.
event
for simulating the events for a given recruitment scenario;
recruitment
for simulating recruitment scenarios.
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=event(r=x,er=0.12,dr=0.08,du=50) eventCourse(r=x,e1=y)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=event(r=x,er=0.12,dr=0.08,du=50) eventCourse(r=x,e1=y)
Function eventWeek
determines the week of the trial in which a certain number t
of events occured.
eventWeek(t, p)
eventWeek(t, p)
t |
result of function |
p |
number of events for which the week shall be determined. |
eventWeek
is an auxilliary function required to assess the timing of interim analyses. It derives
the week of trial in which a certain number of events occured.
The output is required for function cross
, which includes the information into an existing Event diagram.
The week in which the number of events is reached.
cross
for plotting results of function eventWeek
into an existing Event diagram.
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,dr=0.08,du=50) eventCourse(r=x,e1=y) trialWeek(t=y,p=50)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,dr=0.08,du=50) eventCourse(r=x,e1=y) trialWeek(t=y,p=50)
Function recruitment
simulates the recruitment of patients in clinical trials.
recruitment(nc, ns, cw, sw, sf, tb, en)
recruitment(nc, ns, cw, sw, sf, tb, en)
nc |
maximum number of centers to be opened or |
ns |
maximum number of patients to be screened within each center or |
cw |
number of center openings per week. |
sw |
number of screened patients per week within each center. |
sf |
screening failure rate. |
tb |
time between screening and enrollment/randomization in weeks. |
en |
number of patients to be enrolled. |
Function recruitment
simulates the recruitment progress for a required
number of enrolled patients in clinical trials based on the expected number
of centers to be opened per week and the expected number of patients being recruited per site and week.
The function assumes that centers are being opened at a constant rate per week (cw
)
and patient per center are screened at a constant rate per week (sw
).
The function can handle recruitment limits by limiting the total number of centers (nc
)
and/or the number of patients recruitable per site (ns
).
The function discriminates between screening timepoint and enrollment/randomization timepoint by
allowing a screening period (tb
) and screen failure rate (sf
) to be specified.
If both are zero then patients are directly enrolled at screening.
Function recruitment
can handle four different recruitment scenarios.
Scenario 1. Centers are being opened over the entire trial duration,
i.e. no limit of centers (nc=Inf
) and are kept open during the complete trial duration,
i.e. no limit of patients per center (ns=Inf
).
Scenario 2. Only a limited number of centers can be opened (nc=
a positive number) and are
kept open during the complete trial duration (ns=Inf
).
Scenario 3. Centers are being opened over the entire trial duration (nc=Ind
) and are
only have a limited capacity for patient recruitment (ns=
a positive number).
Scenario 4. Only a limited number of centers can be opened (nc=
a positive number) and are
only have a limited capacity for patient recruitment (ns=
a positive number).
Under scenario 4 only a limited number of patients can be recruited. The auxilliary function capacity
can
be used to derive the maximum number of patients that can be enrolled under this scenario.
Results of recruitment
are required as input for function treatment
to derive
the time when treatment of patients is finished.
recruitment
returns a list of vectors with the following components:
weeksOfTrial
a vector counting the trial week for recruitment(from 0 (start of site openings) to the required number of weeks for recruitment)
openCenters
a vector with the (cumulative) number of opened centers per trial week
closedCenters
a vector with the (cumulative) number of closed centers per trial week
centerWeeks
a vector with the (cumulative) number of opened center weeks per trial week
screenings
a vector with the (cumulative) number of screened patients per trial week
weeksOfEnrollment
a vector counting the weeks of enrollment (with start of site openings as reference start)
enrollments
a vector with the (cumulative) number of enrolled/randomized patients per week of enrollment
treatment
for simulating the treatment duration for a given recruitment scenario;
trialCourse
for plots of recruitment and treatment scenarios;
capacity
for deriving the maximum number of patients that can be enrolled under scenario 4;
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400)
Function treatment
simulates the treatment phase base on a recruitment scenario simulated by function recruitment
.
treatment(r, du, dr)
treatment(r, du, dr)
r |
recruitment scenario calculated with function |
du |
duration of treatment phase in weeks. |
dr |
drop-out rate during the treatment phase. |
treatment
simulates the treatment period based on a given recruitment scenario.
The function assumes a common fixed treatment length for all subjects (du
).
The drop-out rate may be included via dr
. If drop-out rates are available
only for different time periods, e.g. annual rates, function convertedRate
can be used to convert
the rate to a drop-out rate for the respective treatment duration.
treatment
returns a list of vectors with the following components:
patients
a vector with the (cumulative) number of patients who finished treatment
weeksOfTrial
a vector with the corresponding trial week when patients have finished treatment
(with start of site openings as reference start)
recruitment
for simulating recruitment scenarios;
trialCourse
for plots of recruitment and treatment scenarios;
convertedRate
for converting drop-out rates for different time periods.
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=0.2) z=treatment(r=x,du=52,dr=0.2) x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=0.2) z=treatment(r=x,du=52,dr=0.2) x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3)
Function trialCourse
plots the results of function recruitment
and function treatment
.
trialCourse(r, t1 = NULL, t2 = NULL, lp = "topright")
trialCourse(r, t1 = NULL, t2 = NULL, lp = "topright")
r |
recruitment scenario calculated with function |
t1 |
optional. Treatment phase simulation from function |
t2 |
optional. Treatment phase simulation from function |
lp |
optional. Position of legend, specified by keyword: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", or "center". |
Function trialCourse
produces two plots to display results of enrollment
and treatment simulations.
The first plot displays the cumulative number of centers that have been opened as well as the cumulative number of centers that have been closed, if applicable, per trial week.
The second plot displays the number of patients that have been screened and enrolled per trial week.
If at least one of the parameters t1
and t2
are not NULL
, then
the number of patients finished treatment is also displayed.
It is possible to include two different treatment scenarios into one plot. This option may for example
be used to assess the timing for specific interim analyses, i.e. t1
is used to assess when the
required number of patients for the interim analysis finished treatment while t2
is used to assess
when the required number of patients for the final analysis finished treatment.
treatment
for simulating the treatment duration for a given recruitment scenario;
recruitment
for simulating recruitment scenarios.
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3) trialCourse(r=x,t1=y,t2=z)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3) trialCourse(r=x,t1=y,t2=z)
Function trialWeek
determines the week of the trial in which a certain number p
of patients finished treatment.
trialWeek(t, p)
trialWeek(t, p)
t |
result of function |
p |
number of patients for which the week shall be determined. |
trialWeek
is an auxilliary function required to assess the timing of interim analyses. It derives
the week of trial in which a certain number of patients finished treatment.
The output is required for function cross
, which includes the information into an existing Patients diagram.
The week in which the number of patients is reached.
cross
for plotting results of function trialWeek
into an existing Patients diagram.
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3) trialCourse(r=x,t1=y,t2=z) trialWeek(t=y,p=100)
x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400) y=treatment(r=x,du=26,dr=convertedRate(0.3,52,26)) z=treatment(r=x,du=52,dr=0.3) trialCourse(r=x,t1=y,t2=z) trialWeek(t=y,p=100)