# bdata_generator: Data Generation Function for Binomial RDT Design In BRDT: Binomial Reliability Demonstration Tests

## Description

Define the function to generate the dataset based on the design settings (for Binomial RDT).

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```bdata_generator( Cf, Cv, nvec, G, Cw, N, Rvec, cvec, pi, par = all(), option = c("optimal"), thres_CR ) ```

## Arguments

 `Cf` Fixed costs of RDT `Cv` Variable unit costs of RDT `nvec` Vector of test sample size `G` Reliabilty growth cost `Cw` Average cost per warranty claim `N` Sales volume `Rvec` Vector of lower level reliability requirements `cvec` Vector of maximum allowable failures `pi` Failure probability `par` Specify which columns to return. Default is all columns.The columns include c('n', 'R', 'c', 'CR', 'AP', 'RDT Cost', 'RG Cost', 'RG Cost Expected', 'WS Cost', 'WS Failure Probability', 'WS Cost Expected', 'Overall Cost') `option` Options to get different datasets. Default is 'optimal'. If option = 'all', get all test plans data for all combinations of n, c, R; If option = 'optimal', get test plans data with optimal test sample size for every combination of c, R. `thres_CR` Threshold (acceptable level) of consumer's risk

## Value

Matrix of the dataset

`boptimal_cost` for getting the optial test plan with minimum overall cost; `boptimal_n` for getting the optial test sample size;
 ```1 2 3 4 5 6 7``` ```nvec <- seq(0, 10, 1) Rvec <- seq(0.8, 0.85, 0.01) cvec <- seq(0, 2, 1) pi <- pi_MCSim_beta(M = 5000, seed = 10, a = 1, b = 1) bdata_generator(Cf = 10, Cv = 10, nvec = nvec, G = 10000, Cw = 10, N = 100, Rvec = Rvec, cvec = cvec, pi = pi, par = c('n', 'R', 'c', 'CR', 'AP'), option = c("optimal"), thres_CR = 0.05) ```