Learn R Programming

basksim (version 2.0.2)

toer: Calculate the Type 1 Error Rate for a Basket Trial Design

Description

Calculate the Type 1 Error Rate for a Basket Trial Design

Usage

toer(
  design,
  n,
  p1 = NULL,
  lambda,
  design_params = list(),
  iter = 1000,
  data = NULL,
  ...
)

Value

A numeric value.

Arguments

design

An object created with one of the setup functions.

n

The sample sizes of the baskets. A vector must be used for varying sample sizes.

p1

Probabilities under the alternative hypothesis. If NULL then the type 1 error rate under the global null hypothesis is calculated.

lambda

The posterior probability threshold.

design_params

A list of params that is specific to the class of design.

iter

The number of iterations in the simulation. Is ignored if data is specified.

data

A data matrix with k column with the number of responses for each basket. Has to be generated with get_data. If data is used, then iter is ignored.

...

Further arguments.

Examples

Run this code
# Example for a basket trial with Fujikawa's Design
design <- setup_fujikawa(k = 3, p0 = 0.2)

# Equal sample sizes
toer(design = design, n = 20, p1 = c(0.2, 0.5, 0.5),
  lambda = 0.95, design_params = list(epsilon = 2, tau = 0),
  iter = 1000)

# Unequal sample sizes
toer(design = design, n = c(15, 20, 25), p1 = c(0.2, 0.5, 0.5),
  lambda = 0.95, design_params = list(epsilon = 2, tau = 0),
  iter = 1000)

Run the code above in your browser using DataLab