check_mon_within: Check Within- And Between-Trial Monotonicity Of A Basket...

View source: R/monotonicity.R

check_mon_withinR Documentation

Check Within- And Between-Trial Monotonicity Of A Basket Trial Design

Description

Generic function for checking monotonicity conditions of a basket trial design. Currently only implemented for designs of class fujikawa_x. In that case, the functions are wrappers of baskexact::check_mon_within() and baskexact::check_mon_between().

Usage

check_mon_within(design, ...)

check_mon_between(design, ...)

## S3 method for class 'fujikawa_x'
check_mon_within(
  design,
  n,
  lambda,
  weight_fun,
  weight_params = list(),
  globalweight_fun = NULL,
  globalweight_params = list(),
  details = TRUE,
  ...
)

## S3 method for class 'fujikawa_x'
check_mon_between(
  design,
  n,
  lambda,
  weight_fun,
  weight_params = list(),
  details = TRUE,
  globalweight_fun = NULL,
  globalweight_params = list(),
  ...
)

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.

lambda

The posterior probability threshold.

weight_fun

Which function should be used to calculate the pairwise weights.

weight_params

A list of tuning parameters specific to weight_fun.

globalweight_fun

Which function should be used to calculate the global weights.

globalweight_params

A list of tuning parameters specific to globalweight_fun.

details

Whether the cases where the monotonicity condition is violated should be returned, in case there are any.

Details

Details on the within- and between-trial monotonicity conditions can be found in Baumann et al. 2022.

Value

If details = FALSE then only a logical value is returned. If details = TRUE then if there are any cases where the within-trial monotonicity condition is violated, a list of these cases and their results are returned. If at least one tuning parameter is a vector, then an array that shows for which combination of parameters the within-trial monotonicity condition holds. In this case, the argument details is ignored.

References

Baumann, L., Krisam, J., & Kieser, M. (2022). Monotonicity conditions for avoiding counterintuitive decisions in basket trials. Biometrical Journal, 64(5), 934-947.

Examples

design4 <- setup_fujikawa_x(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2)
check_mon_within(design = design4, n = 15, lambda = 0.99,
                 weight_fun = baskexact::weights_fujikawa,
                 weight_params = list(epsilon = 0.5, tau = 0),
                 details = TRUE)
design3 <- setup_fujikawa_x(k = 3, shape1 = 1, shape2 = 1, p0 = 0.2)
check_mon_between(design = design3, n = 24, lambda = 0.99,
                  weight_fun = baskexact::weights_fujikawa,
                  weight_params = list(epsilon = c(0.5, 1),
                                       tau = c(0, 0.2, 0.3)),
                  globalweight_fun = baskexact::globalweights_fix,
                  globalweight_params = list(w = c(0.5, 0.7)))


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