Title: | Trigger Strategy in Clinical Trials |
---|---|
Description: | The trigger strategy is a general framework for a multistage statistical design with multiple hypotheses, allowing an adaptive selection of interim analyses. The selection of interim stages can be associated with some prespecified endpoints which serve as the trigger. This selection allows us to refine the critical boundaries in hypotheses testing procedures, and potentially increase the statistical power. This package includes several trial designs using the trigger strategy. See Gou, J. (2023), "Trigger strategy in repeated tests on multiple hypotheses", Statistics in Biopharmaceutical Research, 15(1), 133-140, and Gou, J. (2022), "Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints", Biometrical Journal, 64(2), 301-311. |
Authors: | Jiangtao Gou [aut, cre], Fengqing (Zoe) Zhang [aut] |
Maintainer: | Jiangtao Gou <[email protected]> |
License: | GPL-3 |
Version: | 1.2.0 |
Built: | 2024-12-24 06:41:17 UTC |
Source: | CRAN |
This function converts cumulative alpha levels into normal critical boundaries.
alpha2boundary( alphas, t, initIntvl = c(1, 2 * stats::qnorm(p = alphas[1], lower.tail = FALSE)) )
alpha2boundary( alphas, t, initIntvl = c(1, 2 * stats::qnorm(p = alphas[1], lower.tail = FALSE)) )
alphas |
a list of cumulative errors from some error spending functions |
t |
a vector of information times |
initIntvl |
a pair of numbers as the lower and upper bounds of critical boundaries, used for |
The current version of ldbounds::ldBounds
may not work for Hwang-Shih-DeCani boundaries.
a vector of critical boundaries
Jiangtao Gou
library(ldbounds) tvec <- c(0.5,1) result <- ldbounds::ldBounds(t=tvec, iuse=1, alpha=0.05, sides=1) print(result$upper.bounds) bd <- alpha2boundary(alphas = result$exit.pr, t=tvec) print(bd)
library(ldbounds) tvec <- c(0.5,1) result <- ldbounds::ldBounds(t=tvec, iuse=1, alpha=0.05, sides=1) print(result$upper.bounds) bd <- alpha2boundary(alphas = result$exit.pr, t=tvec) print(bd)
This function converts normal critical boundaries to cumulative alpha levels.
boundary2alpha(cvec, t)
boundary2alpha(cvec, t)
cvec |
a vector of critical boundaries |
t |
a vector of information times |
alphas, a vector of cumulative errors
Jiangtao Gou
Fengqing Zhang
t <- c(0.5,0.8,1) iuse <- 4 result <- gbounds(t=t, iuse=iuse) print(result) boundary2alpha(cvec=result$bd, t=t)
t <- c(0.5,0.8,1) iuse <- 4 result <- gbounds(t=t, iuse=iuse) print(result) boundary2alpha(cvec=result$bd, t=t)
This function generate the correlation matrix for group sequential trials with two endpoints.
corrMatGenerator(tp, ts, rhops)
corrMatGenerator(tp, ts, rhops)
tp |
an information fraction vector of Hp |
ts |
an information fraction vector of Hs |
rhops |
a number that shows the correlation coefficient between the test statistics of the primary endpoint and that of the secondary endpoint |
the correlation matrix, Hp goes first, and Hs goes second.
Jiangtao Gou
corrMatGenerator(tp=c(0.64,1), ts=c(0.25,0.49,1), rhops=1)
corrMatGenerator(tp=c(0.64,1), ts=c(0.25,0.49,1), rhops=1)
This function computes the critical boundaries and the error spent until each stage in group sequential trials
gbounds(t, iuse = 1, alpha = 0.05, phi = rep(1, length(alpha)))
gbounds(t, iuse = 1, alpha = 0.05, phi = rep(1, length(alpha)))
t |
a vector of information times |
iuse |
a number of the type of the error spending function, from -2, -1, 1, 2, 3, 4 |
alpha |
a number of type I error rate |
phi |
a parameter for the power family or the HSD gamma family |
If the original Pocock is implemented, we specify iuse=-2
. If the original OBrien-Flemming is implemented, we specify iuse=-1
.
a list of two vectors: bd
critical boundaries, er
error spent until each stage
Jiangtao Gou
t<-c(0.5,0.8,1) iuse <- 4 gbounds(t=t, iuse=iuse) gbounds(t=(1:5)/5, iuse=4, alpha=0.01, phi=-4) gbounds(t=(1:5)/5, iuse=-2, alpha=0.01)
t<-c(0.5,0.8,1) iuse <- 4 gbounds(t=t, iuse=iuse) gbounds(t=(1:5)/5, iuse=4, alpha=0.01, phi=-4) gbounds(t=(1:5)/5, iuse=-2, alpha=0.01)
This function computes the marginal powers.
marginalPwR(cvec, t, delta = 0)
marginalPwR(cvec, t, delta = 0)
cvec |
a vector of critical boundaries |
t |
a vector of information times |
delta |
a number shows the drift paramter |
a number shows the marginal power (delta isn't equal to zero) or type I error (delta is zero)
Jiangtao Gou
marginalPwR(c(2.218,2.218),c(0.1,0.5,1),delta=3) marginalPwR(1.96,t=1,delta=3)
marginalPwR(c(2.218,2.218),c(0.1,0.5,1),delta=3) marginalPwR(1.96,t=1,delta=3)
This function computes the powers of testing the primary and secondary hypotheses using the holm
, maurer-bretz
, bonferroni
methods.
psPwRbhmb( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, groupsize, szratio = 1, effsz0, effsz1, method = "bonferroni" )
psPwRbhmb( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, groupsize, szratio = 1, effsz0, effsz1, method = "bonferroni" )
alpha |
a number shows the overall error rate |
alpha0 |
a number shows the error rate assigned to the primary endpoint initially |
t0 |
a vector shows the information times of the primary endpoint |
t1 |
a vector shows the information times of the secondary endpoint |
tc0 |
a vector shows the calendar times of the primary endpoint |
tc1 |
a vector shows the calendar times of the secondary endpoint |
rho |
a number shows the correlation between the primary and secondary endpoints |
iuse0 |
an integer shows the type of group sequential boundaries used for the primary endpoint |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi0 |
a parameter for the power family or the HSD gamma family for the primary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
usingRhoForBoundary |
an indicator whether using the informaiton of rho to calculate the boundary, default is FALSE (not using) |
groupsize |
a value of sample size in group 1 |
szratio |
a value of the sample size ratio, n2/n1 |
effsz0 |
a value of effect size for hypothesis H0 |
effsz1 |
a value of effect size for hypothesis H1 |
method |
a text of method, including |
The methods include holm
, maurer-bretz
, and bonferroni
. Users can decide whether the correlation information is used or not.
a vector of two values of the probability that H0 is rejected, the probability that H1 is rejected, the power, using holm
, maurer-bretz
, or bonferroni
.
Jiangtao Gou
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311. Tamhane, A. C., Gou, J., Jennison, C., Mehta, C. R., and Curto, T. (2018). A gatekeeping procedure to test a primary and a secondary endpoint in a group sequential design with multiple interim looks. Biometrics, 74(1), 40-48. Tamhane, A. C., & Gou, J. (2022). Chapter 2 - Multiple test procedures based on p-values. In X. Cui, T. Dickhaus, Y. Ding, & J. C. Hsu (Eds.), Handbook of multiple comparisons (Vol. 45, pp. 11–34).
alpha <- 0.025 alpha0 <- 0.0136 iuse0 <- 1 iuse1 <- 2 phi0 <- -4 phi1 <- 1 tc0 <- c(1,2) tc1 <- c(1,2,3) t0 <- c(0.6,1) t1 <- c(0.5,0.9,1) rho <- 0 effsz0 <- 0.33 effsz1 <- 0.30 groupsize=226 szratio=1 method="bonferroni" method = "holm" method="maurer-bretz" psPwRbhmb(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=1, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=usingRhoForBoundary, groupsize=groupsize, szratio=szratio, effsz0=effsz0, effsz1=effsz1, method=method)
alpha <- 0.025 alpha0 <- 0.0136 iuse0 <- 1 iuse1 <- 2 phi0 <- -4 phi1 <- 1 tc0 <- c(1,2) tc1 <- c(1,2,3) t0 <- c(0.6,1) t1 <- c(0.5,0.9,1) rho <- 0 effsz0 <- 0.33 effsz1 <- 0.30 groupsize=226 szratio=1 method="bonferroni" method = "holm" method="maurer-bretz" psPwRbhmb(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=1, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=usingRhoForBoundary, groupsize=groupsize, szratio=szratio, effsz0=effsz0, effsz1=effsz1, method=method)
This function computes the powers of testing the primary and secondary hypotheses using trigger strategy.
psPwRtrigger( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, groupsize, szratio = 1, effsz0, effsz1 )
psPwRtrigger( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, groupsize, szratio = 1, effsz0, effsz1 )
alpha |
a number shows the overall error rate |
alpha0 |
a number shows the error rate assigned to the primary endpoint initially |
t0 |
a vector shows the information times of the primary endpoint |
t1 |
a vector shows the information times of the secondary endpoint |
tc0 |
a vector shows the calendar times of the primary endpoint |
tc1 |
a vector shows the calendar times of the secondary endpoint |
rho |
a number shows the correlation between the primary and secondary endpoints |
iuse0 |
an integer shows the type of group sequential boundaries used for the primary endpoint |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi0 |
a parameter for the power family or the HSD gamma family for the primary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
usingRhoForBoundary |
an indicator whether using the informaiton of rho to calculate the boundary, default is FALSE (not using) |
groupsize |
a value of sample size in group 1 |
szratio |
a value of the sample size ratio, n2/n1 |
effsz0 |
a value of effect size for hypothesis H0 |
effsz1 |
a value of effect size for hypothesis H1 |
a vector of two values of the probability that H0 is rejected, and the probability that H1 is rejected, using the trigger strategy
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311.
alpha <- 0.0250 alpha0 <- 0.0136 iuse0 <- 1 iuse1 <- 2 phi0 <- -4 phi1 <- 1 tc0 <- c(1,2) tc1 <- c(1,2,3) t0 <- c(0.6,1) t1 <- c(0.5,0.9,1) rho <- 0 effsz0 <- 0.33 effsz1 <- 0.30 groupsize=226 szratio=1 psPwRtrigger(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=1, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=FALSE, groupsize=groupsize, szratio=szratio, effsz0=effsz0, effsz1=effsz1)
alpha <- 0.0250 alpha0 <- 0.0136 iuse0 <- 1 iuse1 <- 2 phi0 <- -4 phi1 <- 1 tc0 <- c(1,2) tc1 <- c(1,2,3) t0 <- c(0.6,1) t1 <- c(0.5,0.9,1) rho <- 0 effsz0 <- 0.33 effsz1 <- 0.30 groupsize=226 szratio=1 psPwRtrigger(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=1, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=FALSE, groupsize=groupsize, szratio=szratio, effsz0=effsz0, effsz1=effsz1)
This function computes the critical boundaries for the secondary endpoint in the partially hierarchical group sequential design.
sBoundsPh2( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1h = 1, iuse1t = 1, phi0 = rep(1, length(alpha)), phi1h = rep(1, length(alpha)), phi1t = rep(1, length(alpha)) )
sBoundsPh2( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1h = 1, iuse1t = 1, phi0 = rep(1, length(alpha)), phi1h = rep(1, length(alpha)), phi1t = rep(1, length(alpha)) )
alpha |
a value of overall type I error rate |
alpha0 |
a value of the type I error rate for testing H0 |
t0 |
a vector of information times for H0 |
t1 |
a vector of information times for H1 |
tc0 |
a vector of calendar times for H0 |
tc1 |
a vector of calendar times for H1 |
rho |
a value of the correlation between the test statistics for H0 and H1. |
iuse0 |
a value of the type of error spending function for H0, ranging from 1 to 4 |
iuse1h |
a value of the type of error spending function for H1 first half, ranging from 1 to 4 |
iuse1t |
a value of the type of error spending function for H1 second half, ranging from 1 to 4 |
phi0 |
a value of the parameter of error spending function for H0 |
phi1h |
a value of the parameter of error spending function for H1 first half |
phi1t |
a value of the parameter of error spending function for H1 second half |
a list of two vectors: bd
critical boundaries, er
error spent until each stage
Jiangtao Gou
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311.
alpha <- 0.05 alpha0 <- 0.03 iuse0 <- 4 iuse1h <- 4 iuse1t <- 4 phi0 <- -4 phi1h <- 1 phi1t <- 1 tc0 <- c(3,6,9,12) tc1 <- c(6,12,18,24) t0 <- c(0.3,0.6,0.9,1) t1 <- (1:4)/4 rho <- 0 sBoundsPh2(alpha, alpha0, t0, t1, tc0, tc1, rho, iuse0, iuse1h, iuse1t, phi0, phi1h, phi1t) alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.0; sBoundsPh2(alpha, alpha0, t0, t1, tc0, tc1, rho, iuse0, iuse1h=iuse1, iuse1t=iuse1, phi0, phi1h=phi1, phi1t=phi1)
alpha <- 0.05 alpha0 <- 0.03 iuse0 <- 4 iuse1h <- 4 iuse1t <- 4 phi0 <- -4 phi1h <- 1 phi1t <- 1 tc0 <- c(3,6,9,12) tc1 <- c(6,12,18,24) t0 <- c(0.3,0.6,0.9,1) t1 <- (1:4)/4 rho <- 0 sBoundsPh2(alpha, alpha0, t0, t1, tc0, tc1, rho, iuse0, iuse1h, iuse1t, phi0, phi1h, phi1t) alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.0; sBoundsPh2(alpha, alpha0, t0, t1, tc0, tc1, rho, iuse0, iuse1h=iuse1, iuse1t=iuse1, phi0, phi1h=phi1, phi1t=phi1)
This function computes the type I error rate of the overall null hypothesis using the partial hierarchical group sequential design.
sErrRphInt2(cvec0, cvec1, t0, t1, tc0 = t0, tc1 = t1, rho = 0)
sErrRphInt2(cvec0, cvec1, t0, t1, tc0 = t0, tc1 = t1, rho = 0)
cvec0 |
a vector of critical boundaries for testing H0 |
cvec1 |
a vector of critical boundaries for testing H1 |
t0 |
a vector of information times for H0 |
t1 |
a vector of information times for H1 |
tc0 |
a vector of calendar times for H0 |
tc1 |
a vector of calendar times for H1 |
rho |
a value of the correlation between the test statistics for H0 and H1. |
a number shows the type I error rate of testing H0 intersect H1
Jiangtao Gou
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311. Tamhane, A. C., Gou, J., Jennison, C., Mehta, C. R., and Curto, T. (2018). A gatekeeping procedure to test a primary and a secondary endpoint in a group sequential design with multiple interim looks. Biometrics, 74(1), 40-48. Tamhane, A. C., & Gou, J. (2022). Chapter 2 - Multiple test procedures based on p-values. In X. Cui, T. Dickhaus, Y. Ding, & J. C. Hsu (Eds.), Handbook of multiple comparisons (Vol. 45, pp. 11–34).
alpha0 <- 0.03 alpha1 <- 0.02 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- 1 tc0 <- c(3,6,9,12) tc1 <- c(6,12,18,24) t0 <- c(0.3,0.6,0.9,1) t1 <- (1:4)/4 rho <- 0 cvecList0 <- gbounds(t=t0,iuse=iuse0, alpha=alpha0,phi=phi0) cvec0 <- cvecList0$bd cvecList1 <- gbounds(t=t1,iuse=iuse1, alpha=alpha1,phi=phi1) cvec1 <- cvecList1$bd result <- sErrRphInt2(cvec0, cvec1, t0, t1, tc0, tc1, rho) print(result)
alpha0 <- 0.03 alpha1 <- 0.02 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- 1 tc0 <- c(3,6,9,12) tc1 <- c(6,12,18,24) t0 <- c(0.3,0.6,0.9,1) t1 <- (1:4)/4 rho <- 0 cvecList0 <- gbounds(t=t0,iuse=iuse0, alpha=alpha0,phi=phi0) cvec0 <- cvecList0$bd cvecList1 <- gbounds(t=t1,iuse=iuse1, alpha=alpha1,phi=phi1) cvec1 <- cvecList1$bd result <- sErrRphInt2(cvec0, cvec1, t0, t1, tc0, tc1, rho) print(result)
This function computes the sample size and the error rate pre-assigned to the primary endpoint using methods of trigger
, holm
, maurer-bretz
, bonferroni
.
solveAlphaXsampleSize( alpha, beta0, beta1, effsz0, effsz1, szratio = 1, t0 = 1, t1 = 1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, method = "trigger", myinit )
solveAlphaXsampleSize( alpha, beta0, beta1, effsz0, effsz1, szratio = 1, t0 = 1, t1 = 1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, method = "trigger", myinit )
alpha |
a number of overall type I error rate |
beta0 |
a number of type II error rate for H0 |
beta1 |
a number of type II error rate for H1 |
effsz0 |
a number of the effect size of testing H0 |
effsz1 |
a number of the effect size of testing H1 |
szratio |
a number of the ratio of sample size of testing H0 to that of testing H1 |
t0 |
a vector of information times for H0 |
t1 |
a vector of information times for H1 |
tc0 |
a vector of calendar times for H0 |
tc1 |
a vector of calendar times for H1 |
rho |
a value of correlation coefficient between H0 and H1 |
iuse0 |
an integer shows the type of group sequential boundaries used for the primary endpoint |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi0 |
a parameter for the power family or the HSD gamma family for the primary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
usingRhoForBoundary |
an indicator whether using the informaiton of rho to calculate the boundary, default is FALSE (not using) |
method |
a text of method, including |
myinit |
a vector of two starting points for alpha0 and sample size. |
a list of two values, alpha0
and groupsize
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311.
# Single Stage Example alpha <- 0.025 effsz0 <- 0.4 effsz1 <- 0.30 szratio <- 1 beta0 <- 0.10 beta1 <- 0.20 solveAlphaXsampleSize(alpha, beta0, beta1, effsz0, effsz1, szratio) # Multi-stage example alpha <- 0.025 beta0 <- 0.10 beta1 <- 0.20 effsz0 <- 0.33 effsz1 <- 0.30 szratio <- 1 t0 <- c(0.5,0.9,1) t1 <- c(0.6,1) tc0 <- c(1,2) tc1 <- c(1,2,3) rho <- 0 iuse0 <- 1 iuse1 <- 2 phi0 <- -4 phi1 <- 1 usingRhoForBoundary <- FALSE myinit <- c(300,alpha/2) myinit <- c(200,alpha/10) method="trigger" method="bonferroni" method="holm" method="maurer-bretz" solveAlphaXsampleSize(alpha=alpha, beta0=beta0, beta1=beta1, effsz0=effsz0, effsz1=effsz1, szratio=szratio, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=usingRhoForBoundary, method=method, myinit=myinit)
# Single Stage Example alpha <- 0.025 effsz0 <- 0.4 effsz1 <- 0.30 szratio <- 1 beta0 <- 0.10 beta1 <- 0.20 solveAlphaXsampleSize(alpha, beta0, beta1, effsz0, effsz1, szratio) # Multi-stage example alpha <- 0.025 beta0 <- 0.10 beta1 <- 0.20 effsz0 <- 0.33 effsz1 <- 0.30 szratio <- 1 t0 <- c(0.5,0.9,1) t1 <- c(0.6,1) tc0 <- c(1,2) tc1 <- c(1,2,3) rho <- 0 iuse0 <- 1 iuse1 <- 2 phi0 <- -4 phi1 <- 1 usingRhoForBoundary <- FALSE myinit <- c(300,alpha/2) myinit <- c(200,alpha/10) method="trigger" method="bonferroni" method="holm" method="maurer-bretz" solveAlphaXsampleSize(alpha=alpha, beta0=beta0, beta1=beta1, effsz0=effsz0, effsz1=effsz1, szratio=szratio, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=usingRhoForBoundary, method=method, myinit=myinit)
This function computes the sample size and the error rate pre-assigned to the primary endpoint using methods of trigger
, holm
, maurer-bretz
, bonferroni
, with Genetic Algorithms.
solveAlphaXsampleSizeGA( alpha, beta0, beta1, effsz0, effsz1, szratio = 1, t0 = 1, t1 = 1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, method = "trigger", lower = c(1, 1e-04), upper = c(10000, alpha - 1e-04), maxiter = 20, run = 200, seed = 1949 )
solveAlphaXsampleSizeGA( alpha, beta0, beta1, effsz0, effsz1, szratio = 1, t0 = 1, t1 = 1, tc0 = t0, tc1 = t1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE, method = "trigger", lower = c(1, 1e-04), upper = c(10000, alpha - 1e-04), maxiter = 20, run = 200, seed = 1949 )
alpha |
a number of overall type I error rate |
beta0 |
a number of type II error rate for H0 |
beta1 |
a number of type II error rate for H1 |
effsz0 |
a number of the effect size of testing H0 |
effsz1 |
a number of the effect size of testing H1 |
szratio |
a number of the ratio of sample size of testing H0 to that of testing H1 |
t0 |
a vector of information times for H0 |
t1 |
a vector of information times for H1 |
tc0 |
a vector of calendar times for H0 |
tc1 |
a vector of calendar times for H1 |
rho |
a value of correlation coefficient between H0 and H1 |
iuse0 |
an integer shows the type of group sequential boundaries used for the primary endpoint |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi0 |
a parameter for the power family or the HSD gamma family for the primary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
usingRhoForBoundary |
an indicator whether using the informaiton of rho to calculate the boundary, default is FALSE (not using) |
method |
a text of method, including |
lower |
a vector of two lower limits for alpha0 and sample size |
upper |
a vector of two upper limits for alpha0 and sample size. |
maxiter |
a number of maximum number of iterations |
run |
a number of maximum number of consecutive generations without any improvement in the best fitness value before the GA is stopped |
seed |
a number of seed of random number generator |
R package GA
is used for Genetic Algorithms.
a list of two values, alpha0
and groupsize
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311.
alpha=0.025 beta0=0.10 beta1=0.20 effsz0=0.33 effsz1=0.30 szratio=1 t0=c(0.5,0.9,1) t1=c(0.6,1) tc0=c(1,2) tc1=c(1,2,3) rho=0 iuse0=1 iuse1=2 phi0=-4 phi1=1 usingRhoForBoundary=FALSE method="trigger" method="bonferroni" method="holm" method="maurer-bretz" lower = c(180,0.005) upper = c(240, alpha-0.005) maxiter = 1 # Increase this number for more precise results run = 1 # Increase this number for more precise results seed = 123 result <- solveAlphaXsampleSizeGA(alpha=alpha, beta0=beta0, beta1=beta1, effsz0=effsz0, effsz1=effsz1, szratio=szratio, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=usingRhoForBoundary, method=method, lower = lower, upper = upper, maxiter = maxiter, run = run, seed = seed) print(result)
alpha=0.025 beta0=0.10 beta1=0.20 effsz0=0.33 effsz1=0.30 szratio=1 t0=c(0.5,0.9,1) t1=c(0.6,1) tc0=c(1,2) tc1=c(1,2,3) rho=0 iuse0=1 iuse1=2 phi0=-4 phi1=1 usingRhoForBoundary=FALSE method="trigger" method="bonferroni" method="holm" method="maurer-bretz" lower = c(180,0.005) upper = c(240, alpha-0.005) maxiter = 1 # Increase this number for more precise results run = 1 # Increase this number for more precise results seed = 123 result <- solveAlphaXsampleSizeGA(alpha=alpha, beta0=beta0, beta1=beta1, effsz0=effsz0, effsz1=effsz1, szratio=szratio, t0=t0, t1=t1, tc0=tc0, tc1=tc1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=usingRhoForBoundary, method=method, lower = lower, upper = upper, maxiter = maxiter, run = run, seed = seed) print(result)
This function computes the power of testing the secondary hypothesis using Holm
sPwRholm( alpha, alpha0, t0, t1, delta0, delta1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)) )
sPwRholm( alpha, alpha0, t0, t1, delta0, delta1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)) )
alpha |
a number shows the overall error rate |
alpha0 |
a number shows the error rate assigned to the primary endpoint initially |
t0 |
a vector shows the information times of the primary endpoint |
t1 |
a vector shows the information times of the secondary endpoint |
delta0 |
a value of delta for hypothesis H0 |
delta1 |
a value of delta for hypothesis H1 |
rho |
a number shows the correlation between the primary and secondary endpoints |
iuse0 |
an integer shows the type of group sequential boundaries used for the primary endpoint |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi0 |
a parameter for the power family or the HSD gamma family for the primary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
a number shows the statistical power of rejecting H1
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRholm(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, delta0=delta0, delta1=delta1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1)
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRholm(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, delta0=delta0, delta1=delta1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1)
This function computes the power of testing the secondary hypothesis using Holm-Ye
sPwRholmye( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, delta0, delta1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)) )
sPwRholmye( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, delta0, delta1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)) )
alpha |
a number shows the overall error rate |
alpha0 |
a number shows the error rate assigned to the primary endpoint initially |
t0 |
a vector shows the information times of the primary endpoint |
t1 |
a vector shows the information times of the secondary endpoint |
tc0 |
a vector shows the calendar times of the primary endpoint |
tc1 |
a vector shows the calendar times of the secondary endpoint |
delta0 |
a value of delta for hypothesis H0 |
delta1 |
a value of delta for hypothesis H1 |
rho |
a number shows the correlation between the primary and secondary endpoints |
iuse0 |
an integer shows the type of group sequential boundaries used for the primary endpoint |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi0 |
a parameter for the power family or the HSD gamma family for the primary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
a number shows the statistical power of rejecting H1
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRholmye(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, delta0=delta0, delta1=delta1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1)
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRholmye(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, delta0=delta0, delta1=delta1, rho=rho, iuse0=iuse0, iuse1=iuse1, phi0=phi0, phi1=phi1)
This function computes the power of testing the secondary hypothesis using Bonferroni
sPwRnaiveBonf( alpha, alpha0 = alpha/2, t1, delta1, iuse1, phi1 = rep(1, length(alpha)) )
sPwRnaiveBonf( alpha, alpha0 = alpha/2, t1, delta1, iuse1, phi1 = rep(1, length(alpha)) )
alpha |
a number shows the overall error rate |
alpha0 |
a number shows the error rate assigned to the primary endpoint initially |
t1 |
a vector shows the information times of the secondary endpoint |
delta1 |
a value of delta for hypothesis H1 |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
a value of the probability that H1 is rejected, the power, using the naive Bonferroni method
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRnaiveBonf(alpha=alpha, alpha0=alpha0, t1=t1, delta1=delta1, iuse1=iuse1, phi1=phi1)
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRnaiveBonf(alpha=alpha, alpha0=alpha0, t1=t1, delta1=delta1, iuse1=iuse1, phi1=phi1)
This function computes the power of testing the secondary hypothesis in partially hierarchical design.
sPwRph2(cvec0, cvec1, delta0, delta1, t0, t1, tc0 = t0, tc1 = t1, rho = 0)
sPwRph2(cvec0, cvec1, delta0, delta1, t0, t1, tc0 = t0, tc1 = t1, rho = 0)
cvec0 |
a vector of critical boundaries for testing H0 |
cvec1 |
a vector of critical boundaries for testing H1 |
delta0 |
a value of drift parameter for testing H0 |
delta1 |
a value of drift parameter for testing H1 |
t0 |
a vector of information times for H0 |
t1 |
a vector of information times for H1 |
tc0 |
a vector of calendar times for H0 |
tc1 |
a vector of calendar times for H1 |
rho |
a value of correlation coefficient between H0 and H1 |
a value of the probability that H1 is rejected, the power
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311.
alpha <- 0.05 alpha0 <- 0.03 iuse0 <- 4 iuse1h <- 4 iuse1t <- 4 phi0 <- -4 phi1h <- 1 phi1t <- 1 tc0 <- c(3,6,9,12) tc1 <- c(6,12,18,24) t0 <- c(0.3,0.6,0.9,1) t1 <- (1:4)/4 rho <- 0 cvecList0 <- gbounds(t=t0, iuse=iuse0, alpha=alpha0, phi=phi0) cvec0 <- cvecList0$bd cvecList1 <- sBoundsPh2(alpha, alpha0, t0, t1, tc0, tc1, rho, iuse0, iuse1h, iuse1t, phi0, phi1h, phi1t) cvec1 <- cvecList1$bd sPwRph2(cvec0, cvec1, delta0=2, delta1=3, t0, t1, tc0, tc1, rho=0)
alpha <- 0.05 alpha0 <- 0.03 iuse0 <- 4 iuse1h <- 4 iuse1t <- 4 phi0 <- -4 phi1h <- 1 phi1t <- 1 tc0 <- c(3,6,9,12) tc1 <- c(6,12,18,24) t0 <- c(0.3,0.6,0.9,1) t1 <- (1:4)/4 rho <- 0 cvecList0 <- gbounds(t=t0, iuse=iuse0, alpha=alpha0, phi=phi0) cvec0 <- cvecList0$bd cvecList1 <- sBoundsPh2(alpha, alpha0, t0, t1, tc0, tc1, rho, iuse0, iuse1h, iuse1t, phi0, phi1h, phi1t) cvec1 <- cvecList1$bd sPwRph2(cvec0, cvec1, delta0=2, delta1=3, t0, t1, tc0, tc1, rho=0)
This function computes the power of testing the secondary hypothesis using Trigger strategy
sPwRtrigger( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, delta0, delta1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE )
sPwRtrigger( alpha, alpha0, t0, t1, tc0 = t0, tc1 = t1, delta0, delta1, rho = 0, iuse0 = 1, iuse1 = 1, phi0 = rep(1, length(alpha)), phi1 = rep(1, length(alpha)), usingRhoForBoundary = FALSE )
alpha |
a number shows the overall error rate |
alpha0 |
a number shows the error rate assigned to the primary endpoint initially |
t0 |
a vector shows the information times of the primary endpoint |
t1 |
a vector shows the information times of the secondary endpoint |
tc0 |
a vector shows the calendar times of the primary endpoint |
tc1 |
a vector shows the calendar times of the secondary endpoint |
delta0 |
a value of delta for hypothesis H0 |
delta1 |
a value of delta for hypothesis H1 |
rho |
a number shows the correlation between the primary and secondary endpoints |
iuse0 |
an integer shows the type of group sequential boundaries used for the primary endpoint |
iuse1 |
an integer shows the type of group sequential boundaries used for the secondary endpoint |
phi0 |
a parameter for the power family or the HSD gamma family for the primary endpoint |
phi1 |
a parameter for the power family or the HSD gamma family for the secondary endpoint |
usingRhoForBoundary |
an indicator whether using the informaiton of rho to calculate the boundary, default is FALSE (not using) |
a value of the probability that H1 is rejected, the power, using the trigger strategy
Gou, J. (2023). Trigger strategy in repeated tests on multiple hypotheses. Statistics in Biopharmaceutical Research, 15(1), 133-140. Gou, J. (2022). Sample size optimization and initial allocation of the significance levels in group sequential trials with multiple endpoints. Biometrical Journal, 64(2), 301-311.
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRtrigger(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, delta0=delta0, delta1=delta1, rho=rho, iuse0=1, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=FALSE)
alpha <- 0.025 alpha0 <- 0.01 iuse0 <- 4 iuse1 <- 4 phi0 <- -4 phi1 <- -4 tc0 <- c(3,6,9,12,18) tc1 <- c(6,12,18,36) t0 <- (1:5)/5 t1 <- (1:4)/4 rho <- 0.5 delta0 <- 1 delta1 <- 3 sPwRtrigger(alpha=alpha, alpha0=alpha0, t0=t0, t1=t1, tc0=tc0, tc1=tc1, delta0=delta0, delta1=delta1, rho=rho, iuse0=1, iuse1=iuse1, phi0=phi0, phi1=phi1, usingRhoForBoundary=FALSE)