fixed_design: Fixed design sample size

View source: R/fixed_design.R

fixed_designR Documentation

Fixed design sample size

Description

Computes fixed design sample size for many sample size methods. Returns a tibble with a basic summary

Usage

fixed_design(
  x = c("AHR", "FH", "MB", "LF", "RD", "MaxCombo", "RMST", "Milestone"),
  alpha = 0.025,
  power = NULL,
  ratio = 1,
  studyDuration = 36,
  ...
)

Arguments

x

Sample size method; default is "AHR"; other options include "FH", "MB", "LF", "RD", "MaxCombo", "Milestone".

alpha

One-sided Type I error (strictly between 0 and 1)

power

Power (NULL to compute power or strictly between 0 and 1 - alpha otherwise)

ratio

Experimental:Control randomization ratio

studyDuration

study duration

...

additional arguments like enrollRates, failRates, rho, gamma, tau

Value

a table

Examples

library(dplyr)

# Average hazard ratio
x <- fixed_design("AHR", 
                  alpha = .025, power = .9, 
                  enrollRates = tibble::tibble(Stratum = "All",  duration = 18, rate = 1),
                  failRates = tibble::tibble(Stratum = "All", duration = c(4, 100), failRate = log(2) / 12, hr = c(1, .6), dropoutRate = .001),
                  studyDuration = 36)
x %>% summary()            

# Lachin and Foulkes (uses gsDesign::nSurv())
x <- fixed_design("LF", 
                  alpha = .025, power = .9, 
                  enrollRates = tibble::tibble(Stratum = "All",  duration = 18, rate = 1),
                  failRates = tibble::tibble(Stratum = "All", duration = 100, failRate = log(2) / 12, hr = .7, dropoutRate = .001),
                  studyDuration = 36)
x %>% summary()

# RMST
x <- fixed_design("RMST", alpha = .025, power = .9, 
                  enrollRates = tibble::tibble(Stratum = "All",  duration = 18, rate = 1),
                  failRates = tibble::tibble(Stratum = "All", duration = 100, failRate = log(2) / 12, hr = .7, dropoutRate = .001),
                  studyDuration = 36,
                  tau = 18)
x %>% summary()

# Milestone 
x <- fixed_design("Milestone", alpha = .025, power = .9, 
                  enrollRates = tibble::tibble(Stratum = "All",  duration = 18, rate = 1),
                  failRates = tibble::tibble(Stratum = "All", duration = 100, failRate = log(2) / 12, hr = .7, dropoutRate = .001),
                  studyDuration = 36,
                  tau = 18)
x %>% summary()


keaven/gsDesign2 documentation built on Oct. 13, 2022, 8:42 p.m.