Title: | Trigger Strategy in Clinical Trials |
Version: | 1.2.0 |
Date: | 2023-07-02 |
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. |
License: | GPL-3 |
Encoding: | UTF-8 |
Depends: | R (≥ 4.2.0) |
Imports: | GA (≥ 3.0.0), ldbounds (≥ 2.0.0), mvtnorm (≥ 1.1.0), nleqslv (≥ 3.0.0), stats (≥ 4.0.0) |
RoxygenNote: | 7.2.3 |
NeedsCompilation: | no |
Packaged: | 2023-07-02 17:40:34 UTC; psystat |
Author: | Jiangtao Gou [aut, cre], Fengqing (Zoe) Zhang [aut] |
Maintainer: | Jiangtao Gou <gouRpackage@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2023-07-04 13:40:02 UTC |
Convert cumulative alpha levels to normal critical boundaries
Description
This function converts cumulative alpha levels into normal critical boundaries.
Usage
alpha2boundary(
alphas,
t,
initIntvl = c(1, 2 * stats::qnorm(p = alphas[1], lower.tail = FALSE))
)
Arguments
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 |
Details
The current version of ldbounds::ldBounds
may not work for Hwang-Shih-DeCani boundaries.
Value
a vector of critical boundaries
Author(s)
Jiangtao Gou
Examples
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)
Convert normal critical boundaries to cumulative alpha levels.
Description
This function converts normal critical boundaries to cumulative alpha levels.
Usage
boundary2alpha(cvec, t)
Arguments
cvec |
a vector of critical boundaries |
t |
a vector of information times |
Value
alphas, a vector of cumulative errors
Author(s)
Jiangtao Gou
Fengqing Zhang
Examples
t <- c(0.5,0.8,1)
iuse <- 4
result <- gbounds(t=t, iuse=iuse)
print(result)
boundary2alpha(cvec=result$bd, t=t)
Correlation matrix generator
Description
This function generate the correlation matrix for group sequential trials with two endpoints.
Usage
corrMatGenerator(tp, ts, rhops)
Arguments
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 |
Value
the correlation matrix, Hp goes first, and Hs goes second.
Author(s)
Jiangtao Gou
Examples
corrMatGenerator(tp=c(0.64,1),
ts=c(0.25,0.49,1),
rhops=1)
Critical boundary in group sequential trials
Description
This function computes the critical boundaries and the error spent until each stage in group sequential trials
Usage
gbounds(t, iuse = 1, alpha = 0.05, phi = rep(1, length(alpha)))
Arguments
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 |
Details
If the original Pocock is implemented, we specify iuse=-2
. If the original OBrien-Flemming is implemented, we specify iuse=-1
.
Value
a list of two vectors: bd
critical boundaries, er
error spent until each stage
Author(s)
Jiangtao Gou
Examples
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)
Marginal Power Rate
Description
This function computes the marginal powers.
Usage
marginalPwR(cvec, t, delta = 0)
Arguments
cvec |
a vector of critical boundaries |
t |
a vector of information times |
delta |
a number shows the drift paramter |
Value
a number shows the marginal power (delta isn't equal to zero) or type I error (delta is zero)
Author(s)
Jiangtao Gou
Examples
marginalPwR(c(2.218,2.218),c(0.1,0.5,1),delta=3)
marginalPwR(1.96,t=1,delta=3)
Powers of testing the primary and secondary hypotheses
Description
This function computes the powers of testing the primary and secondary hypotheses using the holm
, maurer-bretz
, bonferroni
methods.
Usage
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"
)
Arguments
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 |
Details
The methods include holm
, maurer-bretz
, and bonferroni
. Users can decide whether the correlation information is used or not.
Value
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
.
Author(s)
Jiangtao Gou
References
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).
Examples
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)
Powers of testing the primary and secondary hypotheses using trigger strategy
Description
This function computes the powers of testing the primary and secondary hypotheses using trigger strategy.
Usage
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
)
Arguments
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 |
Value
a vector of two values of the probability that H0 is rejected, and the probability that H1 is rejected, using the trigger strategy
References
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.
Examples
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)
Critical boundaries for the secondary endpoint in the partially hierarchical group sequential design
Description
This function computes the critical boundaries for the secondary endpoint in the partially hierarchical group sequential design.
Usage
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))
)
Arguments
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 |
Value
a list of two vectors: bd
critical boundaries, er
error spent until each stage
Author(s)
Jiangtao Gou
References
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.
Examples
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)
Type I error rate of the overall null hypothesis using the partial hierarchical design
Description
This function computes the type I error rate of the overall null hypothesis using the partial hierarchical group sequential design.
Usage
sErrRphInt2(cvec0, cvec1, t0, t1, tc0 = t0, tc1 = t1, rho = 0)
Arguments
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. |
Value
a number shows the type I error rate of testing H0 intersect H1
Author(s)
Jiangtao Gou
References
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).
Examples
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)
Power of testing the secondary hypothesis using Holm
Description
This function computes the power of testing the secondary hypothesis using Holm
Usage
sPwRholm(
alpha,
alpha0,
t0,
t1,
delta0,
delta1,
rho = 0,
iuse0 = 1,
iuse1 = 1,
phi0 = rep(1, length(alpha)),
phi1 = rep(1, length(alpha))
)
Arguments
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 |
Value
a number shows the statistical power of rejecting H1
Examples
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)
Power of testing the secondary hypothesis using Holm-Ye
Description
This function computes the power of testing the secondary hypothesis using Holm-Ye
Usage
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))
)
Arguments
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 |
Value
a number shows the statistical power of rejecting H1
Examples
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)
Power of testing the secondary hypothesis using Bonferroni
Description
This function computes the power of testing the secondary hypothesis using Bonferroni
Usage
sPwRnaiveBonf(
alpha,
alpha0 = alpha/2,
t1,
delta1,
iuse1,
phi1 = rep(1, length(alpha))
)
Arguments
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 |
Value
a value of the probability that H1 is rejected, the power, using the naive Bonferroni method
Examples
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)
Power of testing the secondary hypothesis in partially hierarchical design
Description
This function computes the power of testing the secondary hypothesis in partially hierarchical design.
Usage
sPwRph2(cvec0, cvec1, delta0, delta1, t0, t1, tc0 = t0, tc1 = t1, rho = 0)
Arguments
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 |
Value
a value of the probability that H1 is rejected, the power
References
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.
Examples
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)
Power of testing the secondary hypothesis using Trigger strategy
Description
This function computes the power of testing the secondary hypothesis using Trigger strategy
Usage
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
)
Arguments
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) |
Value
a value of the probability that H1 is rejected, the power, using the trigger strategy
References
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.
Examples
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)
Sample size calculation
Description
This function computes the sample size and the error rate pre-assigned to the primary endpoint using methods of trigger
, holm
, maurer-bretz
, bonferroni
.
Usage
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
)
Arguments
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. |
Value
a list of two values, alpha0
and groupsize
References
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.
Examples
# 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)
Sample size calculation using Genetic Algorithms
Description
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.
Usage
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
)
Arguments
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 |
Details
R package GA
is used for Genetic Algorithms.
Value
a list of two values, alpha0
and groupsize
References
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.
Examples
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)