adjust_lambda.default {basksim}R Documentation

Adjust Lambda

Description

Adjust Lambda

Usage

## Default S3 method:
adjust_lambda(
  design,
  n,
  p1 = NULL,
  alpha = 0.05,
  design_params = list(),
  iter = 1000,
  prec_digits = 3,
  data = NULL,
  ...
)

Arguments

design

An object created with one of the setup functions.

n

The sample size per basket.

p1

Probabilities under the alternative hypothesis. If NULL then the type 1 error rate under the global null hypothesis is calculated.

alpha

The one-sided significance level.

design_params

A list of params that is specific to the class of design.

iter

The number of iterations in the simulation. Is ignored if data is specified.

prec_digits

Number of decimal places that are considered when adjusting lambda.

data

A data matrix with k column with the number of responses for each basket. Has to be generated with get_data. If data is used, then iter is ignored.

...

Further arguments.

Details

It is recommended to use data and then use the same simulated data set for all further calculations. If data = NULL then new data is generated in each step of the algorithm, so lambda doesn't necessarily protect the family wise error rate for different simulated data due to Monte Carlo simulation error.

Value

A list containing the greatest estimated value for lambda with prec_digits decimal places which controls the family wise error rate at level alpha (one-sided) and the estimated family wise error rate for the estimated lambda.

Examples

# Example for a basket trial with Fujikawa's Design
design <- setup_fujikawa(k = 3, p0 = 0.2)
adjust_lambda(design = design, n = 20, alpha = 0.05,
  design_params = list(epsilon = 2, tau = 0), iter = 1000)

[Package basksim version 1.0.0 Index]