basket_test.fujikawa_x: Test for the results of a basket trial

View source: R/basket_test.R

basket_test.fujikawa_xR Documentation

Test for the results of a basket trial

Description

This function is a wrapper of baskexact::basket_test(). It returns the posterior probabilities of a basket trial including borrowing.

Usage

## S3 method for class 'fujikawa_x'
basket_test(
  design,
  n,
  r,
  lambda,
  epsilon,
  tau,
  logbase = 2,
  weight_fun = weights_jsd,
  weight_params = list(epsilon = epsilon, tau = tau, logbase = logbase),
  ...
)

Arguments

design

An object of class fujikawa_x.

n

The sample size per basket.

r

A numeric vector of the number of responses in each stratum.

lambda

The posterior probability threshold.

epsilon

Tuning parameter that determines the amount of borrowing. See setup_fujikawa).

tau

Tuning parameter that determines how similar the baskets have to be that information is shared. See setup_fujikawa).

logbase

Tuning parameter. The base of the logarithm that is used to calculate the Jensen-Shannon divergence.

weight_fun

Which functions should be used to calculated the pairwise weights? Default is weights_jsd.

weight_params

A list of tuning parameters specific to weight_fun. By default, it takes the function arguments epsilon, tau and logbase.

...

Further arguments.

Value

A numeric vector of posterior probabilities for all strata.

Examples

design_x <- setup_fujikawa_x(k = 3, p0 = 0.2, backend = "exact")
basket_test(design = design_x, n = 20, r = c(2, 7, 19), lambda = 0.95,
            epsilon = 2, tau = 0,
            logbase = exp(1))

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