as_gt.fixed_design: This is the function to format the bounds summary table of...

View source: R/as_gt.R

as_gt.fixed_designR Documentation

This is the function to format the bounds summary table of fixed design into gt style.

Description

This is the function to format the bounds summary table of fixed design into gt style.

Usage

## S3 method for class 'fixed_design'
as_gt(x, title = NULL, footnote = NULL, ...)

Arguments

x

a summary object of group sequential design

title

title to be displayed

footnote

footnotes to be displayed

...

additional arguments

Value

a gt table

Examples

library(dplyr)
library(tibble)

# Enrollment rate
enrollRates <- tibble(
  Stratum = "All", 
  duration = 18, 
  rate = 20)

# Failure rates
failRates <- tibble(
  Stratum = "All", 
  duration = c(4, 100), 
  failRate = log(2) / 12,
  hr = c(1, .6), 
  dropoutRate = .001)

# Study duration in months
studyDuration <- 36

# Experimental / Control randomization ratio
ratio <- 1 

# 1-sided Type I error
alpha <- 0.025 

# Type II error (1 - power)
beta <- 0.1 

# ------------------------- #
#        AHR                #
# ------------------------- #
# under fixed power 
fixed_design(
  x = "AHR", 
  alpha = alpha, power = 1 - beta, 
  enrollRates = enrollRates, failRates = failRates, 
  studyDuration = studyDuration, ratio = ratio
  ) %>% 
  summary() %>% 
  as_gt()
  
# ------------------------- #
#        FH                 #
# ------------------------- #
# under fixed power
fixed_design(
  x = "FH", 
  alpha = alpha, power = 1 - beta, 
  enrollRates = enrollRates, failRates = failRates, 
  studyDuration = studyDuration, ratio = ratio
  ) %>% 
  summary() %>% 
  as_gt()
  

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