check_mon_within {baskexact}R Documentation

Check Within-Trial Monotonicity

Description

Checks whether the within-trial monotonicity condition holds.

Usage

check_mon_within(design, ...)

## S4 method for signature 'OneStageBasket'
check_mon_within(
  design,
  n,
  lambda,
  weight_fun,
  weight_params = list(),
  globalweight_fun = NULL,
  globalweight_params = list(),
  details = TRUE,
  ...
)

Arguments

design

An object of class Basket created by setupOneStageBasket or setupTwoStageBasket.

...

Further arguments.

n

The sample size per basket.

lambda

The posterior probability threshold. See details for more information.

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

check_mon_within checks whether the within-trial monotonicity condition holds. For a single-stage design with equal prior distributions and equal sample sizes for each basket this condition states that there are no cases where the null hypothesis of a basket is rejected when there is at least one other basket with more observed responses for which the null hypothesis cannot be rejected.

If prune = TRUE then the baskets with an observed number of baskets smaller than the pooled critical value are not borrowed from. The pooled critical value is the smallest integer c for which all null hypotheses can be rejected if the number of responses is exactly c for all baskets.

The function is vectorized, such that vectors can be specified in weight_params and globalweight_params.

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.

Methods (by class)

References

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

Examples

design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2)

# Without vectorization, with details
design <- setupOneStageBasket(k = 4, shape1 = 1, shape2 = 1, p0 = 0.2)
check_mon_within(design = design, n = 24, lambda = 0.99,
  weight_fun = weights_fujikawa, weight_params = list(epsilon = 0.5,
   tau = 0), details = TRUE)

# Vectorized
check_mon_within(design = design, n = 24, lambda = 0.99,
  weight_fun = weights_fujikawa,
  weight_params = list(epsilon = c(0.5, 1),  tau = c(0, 0.2, 0.3)),
  globalweight_fun = globalweights_fix,
  globalweight_params = list(w = c(0.5, 0.7)))

[Package baskexact version 1.0.1 Index]