Skip to contents

Lower and Upper Bound of Group Sequential Design

Usage

gs_bound(
  alpha,
  beta,
  theta,
  corr,
  analysis = 1:length(alpha),
  theta0 = rep(0, length(analysis)),
  binding_lower_bound = FALSE,
  algorithm = GenzBretz(maxpts = 1e+05, abseps = 1e-05),
  alpha_bound = FALSE,
  beta_bound = FALSE,
  ...
)

Arguments

alpha

a numeric vector of cumulative allocated alpha in each interim analysis

beta

a numeric vector of cumulative allocated beta in each interim analysis

theta

a numeric vector of effect size under alternative.

corr

a matrix of correlation matrix

analysis

a numeric vector of interim analysis indicator. Default is 1:length(alpha).

theta0

a numeric vector of effect size under null hypothesis. Default is 0.

binding_lower_bound

a logical value to indicate binding lower bound.

algorithm

an object of class GenzBretz, Miwa or TVPACK specifying both the algorithm to be used as well as the associated hyper parameters.

alpha_bound

logical value to indicate if alpha is Type I error or upper bound. Default is FALSE.

beta_bound

logical value to indicate if beta is Type II error or lower bound. Default is FALSE.

...

additional parameters transfer to mvtnorm::pmvnorm

Specification

The contents of this section are shown in PDF user manual only.

Examples

library(gsDesign)
#> Loading required package: ggplot2

x <- gsDesign::gsSurv( k = 3 , test.type = 4 , alpha = 0.025 ,
                       beta = 0.2 , astar = 0 , timing = c( 1 ) ,
                       sfu = sfLDOF , sfupar = c( 0 ) , sfl = sfLDOF ,
                       sflpar = c( 0 ) , lambdaC = c( 0.1 ) ,
                       hr = 0.6 , hr0 = 1 , eta = 0.01 ,
                       gamma = c( 10 ) ,
                       R = c( 12 ) , S = NULL ,
                       T = 36 , minfup = 24 , ratio = 1 )

cbind(x$lower$bound, x$upper$bound)
#>            [,1]     [,2]
#> [1,] -0.2361874 3.710303
#> [2,]  1.1703638 2.511407
#> [3,]  1.9929702 1.992970

gsdmvn:::gs_bound(alpha = sfLDOF(0.025, 1:3/3)$spend,
         beta = sfLDOF(0.2, 1:3/3)$spend,
         analysis = 1:3,
         theta = x$theta[2] * sqrt(x$n.I),
         corr = outer(1:3, 1:3, function(x,y) pmin(x,y) / pmax(x,y)))
#>      upper      lower
#> 1 3.710295 -0.2361879
#> 2 2.513755  1.1335603
#> 3 2.023170  2.0231696