Title: | Adaptive Clinical Trial Designs with Endpoint Selection and Sample Size Reassessment |
Version: | 1.1 |
Maintainer: | Marta Bofill Roig <marta.bofillroig@meduniwien.ac.at> |
Description: | Endpoint selection and sample size reassessment for multiple binary endpoints based on blinded and/or unblinded data. Trial design that allows an adaptive modification of the primary endpoint based on blinded information obtained at an interim analysis. The decision rule chooses the endpoint with the lower estimated required sample size. Additionally, the sample size is reassessed using the estimated event probabilities and correlation between endpoints. The implemented design is proposed in Bofill Roig, M., Gómez Melis, G., Posch, M., and Koenig, F. (2022). <doi:10.48550/arXiv.2206.09639>. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
Imports: | stats, CompAREdesign |
RoxygenNote: | 7.2.1 |
NeedsCompilation: | no |
Packaged: | 2023-02-02 13:22:06 UTC; marta.bofill |
Author: | Marta Bofill Roig |
Repository: | CRAN |
Date/Publication: | 2023-02-03 10:22:32 UTC |
OR_function
Description
computes the odds ratio
Usage
OR_function(p0, p1)
Value
Odds ratio calculation based on marginal probabilities
corr_rest
Description
computes the correlation restrictions phat0_e1,phat0_e2: estimated probabilities p0_e1,p0_e2,p1_e1,p1_e2: assumed probabilities (design) OR1,OR2: expected effect sizes
Usage
corr_rest_b(phat0_e1, phat0_e2, p0_e1, p0_e2, p1_e1, p1_e2, OR1, OR2)
Value
Correlation bounds based on estimated and assumed probabilities
corr_rest_ub: computes the correlation restrictions unblinded case
Description
computes the correlation restrictions with unblinded data phat0_e1,phat0_e2,phat1_e1,phat1_e2: estimated probabilities p0_e1,p0_e2,p1_e1,p1_e2: assumed probabilities (design) OR1,OR2: expected effect sizes
Usage
corr_rest_ub(
phat0_e1,
phat0_e2,
phat1_e1,
phat1_e2,
p0_e1,
p0_e2,
p1_e1,
p1_e2,
OR1,
OR2
)
Value
Correlation bounds based on estimated and assumed probabilities (unblinded case)
Endpoint selection and sample size reassessment for composite endpoints based on blinded data
Description
Endpoint selection and sample size reassessment for composite endpoints based on blinded data. The composite endpoint is assumed to be a binary endpoint formed by a combination of two events (E1 and E2). We assume that the endpoint 1 is more relevant for the clinical question than endpoint 2. This function selects between the composite endpoint or the relevant endpoint as the primary endpoint of the study and recalculate the sample size accordingly. The decision criteria to decide between the composite endpoint or the relevant endpoint might be the ratio of the corresponding sample sizes ("SS") or the Asymptotic Relative Efficiency ("ARE"). The algorithm of the function is the following: First, the probabilities of the composite components in the control group and the correlation between them are estimated based on blinded data. Second, using the estimated probabilities and the estimated correlation, the decision criteria is computed and the primary endpoint is selected. Finally, the sample size is recalculated according to the decision.
Usage
eselect(db, p0_e1, OR1, p0_e2, OR2, criteria = "SS", alpha = 0.05, beta = 0.2)
Arguments
db |
matrix 2x2 table (pooled sample) |
p0_e1 |
numeric parameter, probability of occurrence E1 in the control group |
OR1 |
numeric parameter, Odds ratio for the endpoint 1 |
p0_e2 |
numeric parameter, probability of occurrence E2 in the control group |
OR2 |
numeric parameter, Odds ratio for the endpoint 2 |
criteria |
decision criteria to choose between the composite endpoint or the endpoint 1 as primary endpoint ("SS": Ratio sample sizes, "ARE": Asymptotic Relative Efficiency). |
alpha |
Type I error. |
beta |
Type II error. |
Value
This function returns the decision (Decision = 1, meaning the chosen endpoint is the composite endpoint; and Decision = 0, meaning the chosen endpoint is the relevant endpoint) and the sample size according to the decision.
References
Bofill Roig, M., Gómez Melis, G., Posch, M., & Koenig, F. (2022). Adaptive clinical trial designs with blinded selection of binary composite endpoints and sample size reassessment. Biostatistics (in press). arXiv e-prints, arXiv-2206 (https://doi.org/10.48550/arXiv.2206.09639). Bofill Roig, M., & Gómez Melis, G. "Selection of composite binary endpoints in clinical trials." Biometrical Journal 60.2 (2018): 246-261.
Examples
# Based on Bofill Roig, M., et al.
# (See supplementary material in https://doi.org/10.48550/arXiv.2206.09639)
p0_e1 = 0.173
p0_e2 = 0.055
p1_e1 = 0.121;
p1_e2 = 0.057;
n1 = 569
n0 = 576
n = n0+n1
p1 = (p0_e1*n0 + p1_e1*n1)/n
p2 = (p0_e2*n0 + p1_e2*n1)/n
p_ce = (0.203*n0 + 0.146*n1)/n
OR1 = 0.7
OR2 = 0.9
x11 = round((p1+p2-p_ce)*n)
x12 = round((p1)*n-x11)
x21 = round((p2)*n- x11)
x22 = round((1-p_ce)*n)
data = matrix(c(x11,x12,x21,x22), nrow = 2 , ncol = 2, byrow = FALSE)
eselect(db=data,p0_e1=0.18,OR1=0.70,p0_e2=0.05,OR2=0.9,criteria="SS",alpha=0.05,beta=0.2)
Endpoint selection and sample size reassessment for composite endpoints based on unblinded data
Description
Endpoint selection and sample size reassessment for composite endpoints based on unblinded data. The composite endpoint is assumed to be a binary endpoint formed by a combination of two events (E1 and E2). We assume that the endpoint 1 is more relevant for the clinical question than endpoint 2. This function selects between the composite endpoint or the relevant endpoint as the primary endpoint of the study and recalculate the sample size accordingly. The decision criteria to decide between the composite endpoint or the relevant endpoint might be the ratio of the corresponding sample sizes ("SS") or the Asymptotic Relative Efficiency ("ARE"). The algorithm of the function is the following: First, the probabilities of the composite components in the control group and the correlation between them are estimated based on unblinded data. Second, using the estimated probabilities and the estimated correlation, the decision criteria is computed and the primary endpoint is selected. Finally, the sample size is recalculated according to the decision.
Usage
eselect_ub(
db0,
db1,
p0_e1,
OR1,
p0_e2,
OR2,
criteria = "SS",
alpha = 0.05,
beta = 0.2
)
Arguments
db0 |
matrix |
db1 |
matrix |
p0_e1 |
numeric parameter, probability of occurrence E1 in the control group |
OR1 |
numeric parameter, Odds ratio for the endpoint 1 |
p0_e2 |
numeric parameter, probability of occurrence E2 in the control group |
OR2 |
numeric parameter, Odds ratio for the endpoint 2 |
criteria |
decision criteria to choose between the composite endpoint or the endpoint 1 as primary endpoint ("SS": Ratio sample sizes, "ARE": Asymptotic Relative Efficiency). |
alpha |
Type I error. |
beta |
Type II error. |
Value
This function returns the decision (Decision = 1, meaning the chosen endpoint is the composite endpoint; and Decision = 0, meaning the chosen endpoint is the relevant endpoint) and the sample size according to the decision.
Simulation trials with endpoint selection and sample size reassessment for composite endpoints based on blinded data
Description
This function simulates trials with endpoint selection and sample size reassessment for composite binary endpoints based on blinded data. The composite endpoint is assumed to be a binary endpoint formed by a combination of two events (E1 and E2). We assume that the endpoint 1 is more relevant for the clinical question than endpoint 2. This function simulates a trial based on the design parameters and use the algorithm implemented in eselect() to select the primary endpoint and recalculate the sample size accordingly.
Usage
eselectsim(
ss_arm,
p0_e1,
OR1,
p0_e2,
OR2,
p0_ce,
p_init = 1,
criteria = "SS",
H0_e1 = FALSE,
H0_e2 = FALSE,
SS_r = TRUE,
alpha = 0.05,
beta = 0.2
)
Arguments
ss_arm |
numeric parameter, sample size per arm |
p0_e1 |
numeric parameter, probability of occurrence E1 in the control group |
OR1 |
numeric parameter, Odds ratio for the endpoint 1 |
p0_e2 |
numeric parameter, probability of occurrence E2 in the control group |
OR2 |
numeric parameter, Odds ratio for the endpoint 2 |
p0_ce |
numeric parameter, probability of occurrence composite endpoint in the control group |
p_init |
numeric parameter, percentage of sample size used in the interim |
criteria |
decision criteria to choose between the composite endpoint or the endpoint 1 as primary endpoint ("SS": Ratio sample sizes, "ARE": Asymptotic Relative Efficiency). |
H0_e1 |
Simulate under true null hypothesis for the endpoint E1 (TRUE/FALSE). |
H0_e2 |
Simulate under true null hypothesis for the endpoint E2 (TRUE/FALSE). |
SS_r |
Sample size reassessment (TRUE/FALSE). If TRUE, in those cases where the sample size is less than the needed for achieving the pre-specified power, additional subjects are added after recalculating the sample size. If FALSE, no more subjects are added in the study. |
alpha |
Type I error. |
beta |
Type II error. |
Value
This function returns the decision (Decision = 1, meaning the chosen endpoint is the composite endpoint; and Decision = 0, meaning the chosen endpoint is the relevant endpoint) and the statistic to test the primary hypothesis according to the decision.
References
Bofill Roig, M., Gómez Melis, G., Posch, M., & Koenig, F. (2022). Adaptive clinical trial designs with blinded selection of binary composite endpoints and sample size reassessment. Biostatistics (in press). arXiv e-prints, arXiv-2206 (https://doi.org/10.48550/arXiv.2206.09639).
Simulation trials with endpoint selection and sample size reassessment for composite endpoints based on unblinded data
Description
This function simulates trials with endpoint selection and sample size reassessment for composite binary endpoints based on unblinded data. The composite endpoint is assumed to be a binary endpoint formed by a combination of two events (E1 and E2). We assume that the endpoint 1 is more relevant for the clinical question than endpoint 2. This function simulates a trial based on the design parameters and use the algorithm implemented in eselect() to select the primary endpoint and recalculate the sample size accordingly.
Usage
eselectsim_ub(
ss_arm,
p0_e1,
OR1,
p0_e2,
OR2,
p0_ce,
p_init = 1,
criteria = "SS",
H0_e1 = FALSE,
H0_e2 = FALSE,
SS_r = TRUE,
alpha = 0.05,
beta = 0.2
)
Arguments
ss_arm |
numeric parameter, sample size per arm |
p0_e1 |
numeric parameter, probability of occurrence E1 in the control group |
OR1 |
numeric parameter, Odds ratio for the endpoint 1 |
p0_e2 |
numeric parameter, probability of occurrence E2 in the control group |
OR2 |
numeric parameter, Odds ratio for the endpoint 2 |
p0_ce |
numeric parameter, probability of composite endpoint in the control group |
p_init |
numeric parameter, percentage of sample size used in the interim |
criteria |
decision criteria to choose between the composite endpoint or the endpoint 1 as primary endpoint ("SS": Ratio sample sizes, "ARE": Asymptotic Relative Efficiency). |
H0_e1 |
Simulate under true null hypothesis for the endpoint E1 (TRUE/FALSE). |
H0_e2 |
Simulate under true null hypothesis for the endpoint E2 (TRUE/FALSE). |
SS_r |
Sample size reassessment (TRUE/FALSE). If TRUE, in those cases where the sample size is less than the needed for achieving the pre-specified power, additional subjects are added after recalculating the sample size. If FALSE, no more subjects are added in the study. |
alpha |
Type I error. |
beta |
Type II error. |
Value
This function returns the decision (Decision = 1, meaning the chosen endpoint is the composite endpoint; and Decision = 0, meaning the chosen endpoint is the relevant endpoint) and the statistic to test the primary hypothesis according to the decision.
Blinded estimation of the correlation
Description
This function estimates the correlation between two binary endpoints based on blinded data.
Usage
estimation_b(samplesize, p0_e1, p1_e1, OR1, p0_e2, p1_e2, OR2, p0_ce, p1_ce)
Arguments
samplesize |
numeric parameter, sample size per arm |
p0_e1 |
numeric parameter, probability of occurrence E1 in the control group |
p1_e1 |
numeric parameter, probability of occurrence E1 in the treatment group |
OR1 |
numeric parameter, Odds ratio for the endpoint 1 (design) |
p0_e2 |
numeric parameter, probability of occurrence E2 in the control group |
p1_e2 |
numeric parameter, probability of occurrence E2 in the treatment group |
OR2 |
numeric parameter, Odds ratio for the endpoint 2 (design) |
p0_ce |
numeric parameter, probability of occurrence composite endpoint in the control group |
p1_ce |
numeric parameter, probability of occurrence composite endpoint in the treatment group |
Value
This function returns the estimated correlation and the truncated correlation within the possible margins.
Unblinded estimation of the correlation
Description
This function estimates the correlation between two binary endpoints based on unblinded data.
Usage
estimation_ub(samplesize, p0_e1, p1_e1, OR1, p0_e2, p1_e2, OR2, p0_ce, p1_ce)
Arguments
samplesize |
numeric parameter, sample size per arm |
p0_e1 |
numeric parameter, probability of occurrence E1 in the control group |
p1_e1 |
numeric parameter, probability of occurrence E1 in the treatment group |
OR1 |
numeric parameter, Odds ratio for the endpoint 1 (design) |
p0_e2 |
numeric parameter, probability of occurrence E2 in the control group |
p1_e2 |
numeric parameter, probability of occurrence E2 in the treatment group |
OR2 |
numeric parameter, Odds ratio for the endpoint 2 (design) |
p0_ce |
numeric parameter, probability of occurrence composite endpoint in the control group |
p1_ce |
numeric parameter, probability of occurrence composite endpoint in the treatment group |
Value
This function returns the estimated correlation based on unblinded data and the truncated correlation within the possible margins.
f_OR
Description
simulates binary outcomes and computes the statistic
Usage
f_OR(samplesize, p0, p1)
Value
Two-sample test statistics using unpooled variance estimator
Simulation 2x2 table binary endpoints
Description
simulation binary data two outcomes
Usage
f_sim(samplesize, p_e1, p_e2, p_ce)
Arguments
samplesize |
sample size simulated sample |
p_e1 |
numeric parameter, probability of occurrence E1 |
p_e2 |
numeric parameter, probability of occurrence E2 |
p_ce |
numeric parameter, probability of occurrence composite endpoint |
Value
Simlated data
the function returns 2x2 table s1+s2: num X1 s1+s3: num X2
fun_p0
Description
computes the probability under the control group based on the pooled probability and the odds ratio p: pooled probability l: odds ratio
Usage
fun_p0(p, l)
Value
Probability under the control group based on OR and pooled probability
samplesize_OR
Description
Sample size calculations in terms of odds ratio
Usage
samplesize_OR(p0, OR, alpha = 0.05, beta = 0.2, Unpooled = "Unpooled Variance")
Value
Sample size for odds ratios
test_f
Description
computes the statistical test (OR)
Usage
test_f(OR, p0, n)
Value
Two-sample test statistics for a single endpoint
test_me
Description
computes the statistical tests (OR) for two endpoints
Usage
test_me(OR1, p0_e1, OR2, p0_e2, n)
Value
Two-sample test statistics for endpoint 1 and 2