Skip to contents

Utility function for root-finding to compute crossing probabilities with the overall alpha spending approach

Usage

find_astar(
  a,
  alpha_prev = NULL,
  astar,
  w,
  sig,
  maxpts = 50000,
  abseps = 1e-05,
  ...
)

Arguments

a

Cumulative overall alpha spending up to current analysis.

alpha_prev

alpha boundary at previous interim analyses using the WPGSD approach.

astar

Total nominal alpha level at current analysis from the WPGSD approach.

w

Vector of alpha weights at current analysis.

sig

Correlation matrix of previous and current analyses test statistics.

maxpts

GenzBretz function maximum number of function values as integer.

abseps

GenzBretz function absolute error tolerance.

...

Additional arguments.

Value

Difference. Should be 0 with a and astar identified.

Examples

# Input event count of intersection of paired hypotheses - Table 2
my_event <- tibble::tribble(
  ~H1, ~H2, ~Analysis, ~Event,
  1, 1, 1, 155,
  2, 2, 1, 160,
  3, 3, 1, 165,
  1, 2, 1, 85,
  1, 3, 1, 85,
  2, 3, 1, 85,
  1, 1, 2, 305,
  2, 2, 2, 320,
  3, 3, 2, 335,
  1, 2, 2, 170,
  1, 3, 2, 170,
  2, 3, 2, 170
)

# Generate correlation from events
my_corr <- generate_corr(my_event)

# Find the inflation factor for H1, H2 at analysis 1
find_astar(
  a = 0.0008708433,
  alpha_prev = NULL,
  aprime = c(0.0004588644, 0.0004119789),
  astar = 1,
  w = c(0.5, 0.5),
  sig = my_corr[
    colnames(my_corr) %in% c("H1_A1", "H2_A1"),
    colnames(my_corr) %in% c("H1_A1", "H2_A1")
  ]
)
#> [1] 0.6583884
#> attr(,"error")
#> [1] 1e-15
#> attr(,"msg")
#> [1] "Normal Completion"