Skip to contents

Group sequential boundary crossing probabilities

Usage

gs_prob(theta, upper = gs_b, lower = gs_b, upar, lpar, info, r = 18)

Arguments

theta

natural parameter for group sequentia design representing expected drift at time of each analysis

upper

function to compute upper bound

lower

function to compare lower bound

upar

parameter to pass to upper

lpar

parameter to pass to lower

info

statistical information at each analysis

r

Integer, at least 2; default of 18 recommended by Jennison and Turnbull

Value

A tibble with a row for each finite bound and analysis containing the following variables: Analysis analysis number Bound Upper (efficacy) or Lower (futility) Z Z-value at bound Probability probability that this is the first bound crossed under the given input theta approximate natural parameter value required to cross the bound

Details

Approximation for theta is based on Wald test and assumes the observed information is equal to the expected.

Examples

library(dplyr)
# Asymmetric 2-sided design
gs_prob(theta = 0, upar = rep(2.2, 3), lpar = rep(0, 3), 
        upper=gs_b, lower=gs_b,  info = 1:3)
#> # A tibble: 6 × 6
#>   Analysis Bound     Z Probability theta  info
#>      <int> <chr> <dbl>       <dbl> <dbl> <int>
#> 1        1 Upper   2.2      0.0139     0     1
#> 2        2 Upper   2.2      0.0236     0     2
#> 3        3 Upper   2.2      0.0305     0     3
#> 4        1 Lower   0        0.5        0     1
#> 5        2 Lower   0        0.625      0     2
#> 6        3 Lower   0        0.687      0     3
# One-sided design
x <- gs_prob(theta = 0, upar = rep(2.2, 3), lpar = rep(-Inf, 3), 
             upper=gs_b, lower=gs_b,  info = 1:3)
# Without filtering, this shows unneeded lower bound
x
#> # A tibble: 6 × 6
#>   Analysis Bound      Z Probability theta  info
#>      <int> <chr>  <dbl>       <dbl> <dbl> <int>
#> 1        1 Upper    2.2      0.0139     0     1
#> 2        2 Upper    2.2      0.0237     0     2
#> 3        3 Upper    2.2      0.0311     0     3
#> 4        1 Lower -Inf        0          0     1
#> 5        2 Lower -Inf        0          0     2
#> 6        3 Lower -Inf        0          0     3
# Filter to just show bounds intended for use
x %>% filter(abs(Z) < Inf)
#> # A tibble: 3 × 6
#>   Analysis Bound     Z Probability theta  info
#>      <int> <chr> <dbl>       <dbl> <dbl> <int>
#> 1        1 Upper   2.2      0.0139     0     1
#> 2        2 Upper   2.2      0.0237     0     2
#> 3        3 Upper   2.2      0.0311     0     3