adjust_lambda {baskexact}R Documentation

Adjust Lambda

Description

Finds the value for lambda such that the family wise error rate is protected at level alpha.

Usage

adjust_lambda(
  design,
  alpha = 0.025,
  theta1 = NULL,
  n,
  epsilon,
  tau,
  logbase,
  prune,
  prec_digits,
  ...
)

## S4 method for signature 'OneStageBasket'
adjust_lambda(
  design,
  alpha = 0.025,
  theta1 = NULL,
  n,
  epsilon,
  tau,
  logbase,
  prune = FALSE,
  prec_digits,
  ...
)

Arguments

design

An object of class Basket created by setupBasket.

alpha

The one-sided signifance level.

theta1

Probabilities under the alternative hypothesis. If length(theta1) == 1, then this is a common probability for all baskets. If is.null(theta1) then the type 1 error rate under the global null hypothesis is computed.

n

The sample size per basket.

epsilon

A tuning parameter that determines the amount of borrowing. See details for more information.

tau

A tuning parameter that determines how similar the baskets have to be that borrowing occurs. See details for more information.

logbase

A tuning parameter that determines which logarithm base is used to compute the Jensen-Shannon divergence. See details for more information.

prune

Whether baskets with a number of responses below the critical pooled value should be pruned before the final analysis.

prec_digits

Number of decimal places that are considered when adjusting lambda

...

Further arguments.

Details

adjust_alpha finds the greatest value with prec_digits for lambda which controls the family wise error rate at level alpha (one-sided). A combination of the uniroot function followed by a grid search is used to finde the correct value for lambda.

This method is implemented for the class OneStageBasket.

Value

The greatest value with prec_digits decimal places for lambda which controls the family wise error rate at level alpha (one-sided) and the exact family wise error rate for this value of lambda.

Methods (by class)

Examples

design <- setupOneStageBasket(k = 3, shape1 = 1, shape2 = 1, theta0 = 0.2)
adjust_lambda(design = design, alpha = 0.025, n = 15, epsilon = 1, tau = 0,
  logbase = 2, prune = FALSE, prec_digits = 4)

[Package baskexact version 0.1.0 Index]