gs_design_nph: Fixed and group sequential design under non-proportional...

Description Usage Arguments Value Examples

View source: R/gs_design_nph.r

Description

gs_design_nph() is a flexible routine to provide a sample size or power for a fixed or group sequential design under various non-proportional hazards assumptions for either single or multiple strata studies. The piecewise exponential distribution allows a simple method to specify a distribtuion and enrollment pattern where the enrollment, failure and dropout rates changes over time.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
gs_design_nph(
  enrollRates = tibble::tibble(Stratum = "All", duration = c(2, 2, 10), rate = c(3, 6,
    9)),
  failRates = tibble::tibble(Stratum = "All", duration = c(3, 100), failRate =
    log(2)/c(9, 18), hr = c(0.9, 0.6), dropoutRate = rep(0.001, 2)),
  ratio = 1,
  alpha = 0.025,
  beta = 0.1,
  analysisTimes = 30,
  IF = c(0.25, 0.75, 1),
  upper = gs_b,
  upar = gsDesign::gsDesign(k = 3, test.type = 1, n.I = c(0.25, 0.75, 1), maxn.IPlan =
    1, sfu = sfLDOF, sfupar = NULL)$upper$bound,
  lower = gs_b,
  lpar = c(qnorm(0.1), rep(-Inf, length(IF) - 1)),
  r = 18
)

Arguments

enrollRates

Piecewise constant enrollment rates by stratum and time period.

failRates

Piecewise constant control group failure rates, duration for each piecewise constant period, hazard ratio for experimental vs control, and dropout rates by stratum and time period.

ratio

Experimental:Control randomization ratio

alpha

One-sided Type I error

beta

Type II error

analysisTimes

Final calendar time if beta is not NULL

IF

information fraction at planned analyses

upper

Function to produce upper bound

upar

Parameters to pass to upper

lower

Function to produce lower bound

lpar

Parameters to pass to lower

r

Control for grid size; normally leave at default of r=18

Value

A list with 3 tibbles: 1) enrollRates with enrollRates$rate adjusted by sample size calculation and adding N with cumulative enrollment at end of each enrollment rate period, 2) failRates as input, 3) codebounds with a row for each bound and each analysis; rows contain the variables Analysis with analysis number, Z with Z-value bound, Probability with cumulative probability of crossing bound at each analysis under the alternate hypothesis input, theta standardized effect size at each analysis, info cumulative statistical information for theta at each analysis, Time expected timing of analysis, avehr expected average hazard ratio at time of analysis, Events expected events an time of analysis under alternate hypothesis, info0 information under null hypothesis with same expected total events under alternate hypothesis, and N expected enrollment at time of analysis.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Design
x <- gs_design_nph()
# Notice cumulative power is 0.9 (90%)
x
# Check Type I error, non-binding; should be .025 (2.5%)
gs_power_nph(enrollRates = x$enrollRates,
           failRates = x$failRates %>% mutate(hr = 1),
           events = (x$bounds %>% filter(Bound == "Upper"))$Events,
           upar = (x$bounds %>% filter(Bound == "Upper"))$Z,
           lpar = rep(-Inf,3),
           upper = gs_b,
           lower = gs_b
           ) %>% filter(abs(Z) < Inf)
# Power under proportional hazards, HR = 0.75
gs_power_nph(enrollRates = x$enrollRates,
           failRates = x$failRates %>% mutate(hr = .75),
           events = (x$bounds %>% filter(Bound == "Upper"))$Events,
           upar = (x$bounds %>% filter(Bound == "Upper"))$Z,
           lpar = rep(-Inf,3),
           upper = gs_b,
           lower = gs_b
           ) %>% filter(abs(Z) < Inf)

keaven/gsdmvn documentation built on May 30, 2021, 9:49 a.m.