Package 'graposas'

Title: Graphical Approach Optimal Sample Size
Description: Graphical approach provides a useful framework for multiplicity adjustment in clinical trials with multiple endpoints. This package includes statistical methods to optimize sample size over initial weight and transition probability in a graphical approach under a common setting, which is to use marginal power for each endpoint in a trial design. See Zhang, F. and Gou, J. (2023). Sample size optimization for clinical trials using graphical approaches for multiplicity adjustment, Technical Report.
Authors: Jiangtao Gou [aut, cre], Fengqing (Zoe) Zhang [aut]
Maintainer: Jiangtao Gou <[email protected]>
License: GPL-3
Version: 1.0.0
Built: 2024-12-19 06:27:26 UTC
Source: CRAN

Help Index


Sample size optimization using graphical approach in clinical trial design with three hypotheses

Description

This function computes the optimal design using graphical approach along with the minimum sample size when three hypotheses are considered in a clinical trial.

Usage

szgaGA(
  alpha,
  betaVec,
  deltaVec,
  cVec,
  rhoMat,
  lower = c(1, rep(1e-06, 2), rep(1e-06, 3)),
  upper = c(10000, rep(1 - 1e-06, 2), rep(1 - 1e-06, 3)),
  gaIter = c(20, 20),
  penPara = 0.1,
  seed = 2022
)

Arguments

alpha

a value of overall type I error rate

betaVec

a vector of one minus marginal powers for testing H1, H2 and H3, respectively

deltaVec

a vector of effect sizes for testing H1, H2 and H3, respectively

cVec

a vector of coefficients. When testing continuous endpoints, these coefficients are exactly one. When testing binary endpoints, the values are roughly one but not exactly one

rhoMat

a matrix of the correlation coefficients among three hypotheses

lower

a vector of lower limit of sample size n, initial weights w1 and w2, and transition probabilities g12, g23 and g31

upper

a vector of upper limit of sample size n, initial weights w1 and w2, and transition probabilities g12, g23 and g31

gaIter

a vector of two numbers. The first one is the parameter maxiter of the ga function, and the second one is the parameter run of the ga function

penPara

a number of penalization parameter for optimization to balance the sample size requirement and the power requirement

seed

a number of the seed of the random number generator

Details

R package GA is used for Genetic Algorithms.

Value

a vector of six numbers: the optimal sample size n, initial weights w1 and w2, and transition probabilities g12, g23 and g31

Author(s)

Jiangtao Gou

References

Zhang, F. and Gou, J. (2023). Sample size optimization for clinical trials using graphical approaches for multiplicity adjustment, Technical Report. 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

start <- Sys.time()
szgaGA(alpha = 0.025, betaVec = c(0.15, 0.20, 0.10),
       deltaVec = c(0.1111952, 0.1037179, 0.1182625),
       cVec = c(1.003086, 1.002686, 1.00349),
       rhoMat = matrix(c(1,0.5,0.8, 0.5,1,0.6, 0.8,0.6,1), nrow = 3, byrow = TRUE),
       lower = c(750, rep(0.01, 2), rep(0.01, 3)),
       upper = c(850, rep(0.99, 2), rep(0.99, 3)),
       gaIter = c(10, 5),
       penPara = 0.015,
       seed = 234)
end <- Sys.time()
data.frame(time = end - start)

Sample size optimization using graphical approach in clinical trial design with three hypotheses when the transition matrix is pre-specified

Description

This function computes the optimal design using graphical approach along with the minimum sample size when three hypotheses are considered in a clinical trial. The transition matrix is pre-specified and fixed.

Usage

szgaGAw(
  alpha,
  betaVec,
  deltaVec,
  cVec,
  rhoMat,
  transMat,
  lower = c(1, rep(1e-06, 2)),
  upper = c(10000, rep(1 - 1e-06, 2)),
  gaIter = c(20, 20),
  penPara = 0.1,
  seed = 2022
)

Arguments

alpha

a value of overall type I error rate

betaVec

a vector of one minus marginal powers for testing H1, H2 and H3, respectively

deltaVec

a vector of effect sizes for testing H1, H2 and H3, respectively

cVec

a vector of coefficients. When testing continuous endpoints, these coefficients are exactly one. When testing binary endpoints, the values are roughly one but not exactly one

rhoMat

a matrix of the correlation coefficients among three hypotheses

transMat

a matrix of the fixed transition probabilities among three hypotheses

lower

a vector of lower limit of sample size n, and initial weights w1 and w2, where w3 is computed by 1 - w1 - w2

upper

a vector of upper limit of sample size n, and initial weights w1 and w2, where w3 is computed by 1 - w1 - w2

gaIter

a vector of two numbers. The first one is the parameter maxiter of the ga function, and the second one is the parameter run of the ga function

penPara

a number of penalization parameter for optimization to balance the sample size requirement and the power requirement

seed

a number of the seed of the random number generator

Details

R package GA is used for Genetic Algorithms.

Value

a vector of three numbers: the optimal sample size n, and initial weights w1 and w2

Author(s)

Jiangtao Gou

References

Zhang, F. and Gou, J. (2023). Sample size optimization for clinical trials using graphical approaches for multiplicity adjustment, Technical Report. 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

start <- Sys.time()
szgaGAw(alpha = 0.025, betaVec = c(0.15, 0.20, 0.10),
        deltaVec = c(0.1111952, 0.1037179, 0.1335865),
        cVec = c(1.003086, 1.002686, 1.004451),
        rhoMat = matrix(c(1,0.5,0.8, 0.5,1,0.6, 0.8,0.6,1), nrow = 3, byrow = TRUE),
        transMat = matrix(c(0,0.50,0.50, 0.5,0,0.5, 0.5,0.5,0), nrow = 3, byrow = TRUE),
        lower = c(700, rep(0.05, 2)),
        upper = c(900, rep(0.95, 2)),
        gaIter = c(10, 5),
        penPara = 0.0135,
        seed = 234)
end <- Sys.time()
data.frame(time = end - start)

Sample size optimization using graphical approach in clinical trial design with two hypotheses

Description

This function computes the optimal design using graphical approach along with the minimum sample size when two hypotheses are considered in a clinical trial.

Usage

szgaViz(
  alpha,
  beta1,
  beta2,
  deltaVec,
  cVec,
  rho,
  wunit,
  initIntvl,
  visualization = TRUE
)

Arguments

alpha

a value of overall type I error rate

beta1

a value of one minus marginal powers for testing H1

beta2

a value of one minus marginal powers for testing H2

deltaVec

a vector of effect sizes for testing H1 nd H2, respectively

cVec

a vector of coefficients. When testing continuous endpoints, these coefficients are exactly one. When testing binary endpoints, the values are roughly one but not exactly one

rho

a value of correlation coefficients between two hypotheses

wunit

a value of initial weight on H1 for grid search and visualization

initIntvl

a vector of lower and upper limits for searching optimal sample size

visualization

a logical value, indicating whether a visualization is needed

Value

a vector of three numbers: the optimal weight on H1 w1, and optimal sample size n1 (based on H1) and n2 (based on H2), where n1 and n2 should be roughly the same

Author(s)

Jiangtao Gou

Fengqing (Zoe) Zhang

References

Zhang, F. and Gou, J. (2023). Sample size optimization for clinical trials using graphical approaches for multiplicity adjustment, Technical Report. 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

szgaViz(alpha = 0.05, beta1 = 0.20, beta2 = 0.20,
         deltaVec = c(0.3,0.3), cVec = c(1,1), rho = 0.0,
         wunit= 0.01, initIntvl = c(1,1000),
         visualization = FALSE)