pow: Calculate the Power for a Basket Trial Design

View source: R/pow.R

powR Documentation

Calculate the Power for a Basket Trial Design

Description

Generic function for calculating the power of a basket trial design. It defaults to the function pow.default which works similarly to basksim::toer and does not rely on any baskwrap-specific function.

Usage

pow(design, ...)

## Default S3 method:
pow(
  design,
  n,
  p1 = NULL,
  lambda,
  design_params = list(),
  iter = 1000,
  data = NULL,
  ...
)

Arguments

design

An object created with one of the setup_ functions from the basksim package or the baskwrap package.

...

Further arguments.

n

The sample size per basket.

p1

Probabilities under the alternative hypothesis. If length(p1) == 1, then this is a common probability for all baskets.

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.

Value

A numeric value.

Examples

design <- setup_fujikawa_x(k = 3, p0 = 0.2)
pow(design = design, n = 20, p1 = c(0.2, 0.5, 0.5), lambda = 0.95,
     design_params = list(epsilon = 2, tau = 0), iter = 100)

baskwrap documentation built on March 19, 2026, 5:09 p.m.