Free Access Week - Data Engineering + BI
Data Engineering and BI courses are free this week!
Free Access Week - Jun 2-8

baskexact (version 1.0.1)

adjust_lambda: Adjust Lambda

Description

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

Usage

adjust_lambda(design, ...)

# S4 method for OneStageBasket adjust_lambda( design, alpha = 0.025, p1 = NULL, n, weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), prec_digits, ... )

# S4 method for TwoStageBasket adjust_lambda( design, alpha = 0.025, p1 = NULL, n, n1, interim_fun, interim_params = list(), weight_fun, weight_params = list(), globalweight_fun = NULL, globalweight_params = list(), prec_digits, ... )

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.

Arguments

design

An object of class Basket created by setupOneStageBasket or setupTwoStageBasket.

...

Further arguments.

alpha

The one-sided signifance level.

p1

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

n

The sample size per basket.

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.

prec_digits

Number of decimal places that are considered when adjusting lambda.

n1

The sample size per basket for the interim analysis in case of a two-stage design.

interim_fun

Which type of interim analysis should be conducted in case of a two-stage design.

interim_params

A list of tuning parameters specific to interim_fun.

Methods (by class)

  • adjust_lambda(OneStageBasket): Adjust lambda for a single-stage design.

  • adjust_lambda(TwoStageBasket): Adjust lambda for a two-stage design.

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.

Examples

Run this code
design <- setupOneStageBasket(k = 3, shape1 = 1, shape2 = 1, p0 = 0.2)
adjust_lambda(design = design, alpha = 0.025, n = 15,
  weight_fun = weights_fujikawa, prec_digits = 4)

Run the code above in your browser using DataLab