Package 'interim'

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

Help Index


Scheduling interim analyses in clinical trials

Description

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.

Details

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:


Scheduling interim analyses in clinical trials

Description

Function capacity calculates the maximum number of enrollments for a recruitment in scenario 4.

Usage

capacity(nc, ns, sf)

Arguments

nc

maximum number of centers to be opened.

ns

maximum number of patients to be screened within each center.

sf

screening failure rate.

Details

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.

Value

The maximum number of patients that can be enrolled.

See Also

recruitment for simulating recruitment scenarios

Examples

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)

Scheduling interim analyses in clinical trials

Description

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.

Usage

convertedRate(r, w1, w2)

Arguments

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

Details

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.

Value

The converted drop-out rate.

See Also

treatment for simulating the treatment duration for a given recruitment scenario

Examples

convertedRate(r=0.3,w1=52,w2=26)

Scheduling interim analyses in clinical trials

Description

Function cross plots two cossing lines into the patients diagram .

Usage

cross(w, p)

Arguments

w

week where the vertical line is plotted.

p

number of patients where the horizontal line is plotted.

Details

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.

See Also

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.

Examples

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)

Scheduling interim analyses in clinical trials for time-to-event settings

Description

Function event simulates the events base on a recruitment scenario simulated by function recruitment.

Usage

event(r, er, dr, du)

Arguments

r

recruitment scenario calculated with function recruitment.

er

event rate during the clinical trail.

dr

drop-out rate during the clinical trail.

du

duration of the clinical trail in weeks.

Details

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.

Value

  • 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)

See Also

recruitment for simulating recruitment scenarios; eventCourse for plots of recruitment and event scenarios;

Examples

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)

Scheduling interim analyses in clinical trials for time-to-event settings

Description

Function eventCourse plots the results of function recruitment and function event.

Usage

eventCourse(r, e1 = NULL, lp = "topright")

Arguments

r

recruitment scenario calculated with function recruitment.

e1

optional. Event simulation from function event.

lp

optional. Position of legend, specified by keyword: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", or "center".

Details

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.

See Also

event for simulating the events for a given recruitment scenario; recruitment for simulating recruitment scenarios.

Examples

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)

Scheduling interim analyses in clinical trials in a time-to-event setting

Description

Function eventWeek determines the week of the trial in which a certain number t of events occured.

Usage

eventWeek(t, p)

Arguments

t

result of function event.

p

number of events for which the week shall be determined.

Details

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.

Value

The week in which the number of events is reached.

See Also

cross for plotting results of function eventWeek into an existing Event diagram.

Examples

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)

Scheduling interim analyses in clinical trials

Description

Function recruitment simulates the recruitment of patients in clinical trials.

Usage

recruitment(nc, ns, cw, sw, sf, tb, en)

Arguments

nc

maximum number of centers to be opened or Inf.

ns

maximum number of patients to be screened within each center or Inf.

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.

Details

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.

Value

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

See Also

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;

Examples

x=recruitment(nc=Inf,ns=Inf,cw=4,sw=2,sf=0.3,tb=4,en=400)

Scheduling interim analyses in clinical trials

Description

Function treatment simulates the treatment phase base on a recruitment scenario simulated by function recruitment.

Usage

treatment(r, du, dr)

Arguments

r

recruitment scenario calculated with function recruitment.

du

duration of treatment phase in weeks.

dr

drop-out rate during the treatment phase.

Details

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.

Value

  • 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)

See Also

recruitment for simulating recruitment scenarios; trialCourse for plots of recruitment and treatment scenarios; convertedRate for converting drop-out rates for different time periods.

Examples

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)

Scheduling interim analyses in clinical trials

Description

Function trialCourse plots the results of function recruitment and function treatment.

Usage

trialCourse(r, t1 = NULL, t2 = NULL, lp = "topright")

Arguments

r

recruitment scenario calculated with function recruitment.

t1

optional. Treatment phase simulation from function treatment.

t2

optional. Treatment phase simulation from function treatment.

lp

optional. Position of legend, specified by keyword: "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right", or "center".

Details

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.

See Also

treatment for simulating the treatment duration for a given recruitment scenario; recruitment for simulating recruitment scenarios.

Examples

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)

Scheduling interim analyses in clinical trials

Description

Function trialWeek determines the week of the trial in which a certain number p of patients finished treatment.

Usage

trialWeek(t, p)

Arguments

t

result of function treatment.

p

number of patients for which the week shall be determined.

Details

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.

Value

The week in which the number of patients is reached.

See Also

cross for plotting results of function trialWeek into an existing Patients diagram.

Examples

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)