Learn R Programming

basksim (version 1.0.0)

adjust_lambda.bhm: Adjust Lambda for the BHM Design

Description

Adjust Lambda for the BHM Design

Usage

# S3 method for bhm
adjust_lambda(
  design,
  n,
  p1 = NULL,
  alpha = 0.05,
  design_params = list(),
  iter = 1000,
  n_mcmc = 10000,
  prec_digits = 3,
  data = NULL,
  ...
)

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.

Arguments

design

An object created with one of the setup functions.

n

The sample size per basket.

p1

Probabilities used for the simulation. If NULL then all probabilities are set to p0.

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.

n_mcmc

Number of MCMC samples.

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.

Examples

Run this code
design <- setup_bhm(k = 3, p0 = 0.2, p_target = 0.5)
adjust_lambda(design = design, n = 15,
  design_params = list(tau_scale = 1), iter = 100, n_mcmc = 5000)

Run the code above in your browser using DataLab