# vectorize: Vectorizes BCOSSA Solutions In metinbulus/cosa: Bound Constrained Optimal Sample Size Allocation

## Description

Vectorizes bound constrained optimal sample size allocation (BCOSSA) solutions based on multiple sets of parameter values. This is particularly useful when multiple values of design parameters are to be considered.

## Usage

 ```1 2 3``` ``` vectorize.cosa(x, score = NULL, args.grid, args.names = NULL, ordered = TRUE, ncase = 10L) ```

## Arguments

 `x` an object returned from one of the `cosa.()` functions. `score` vector or list; an empirical score variable or an object with class 'score' returned from the `inspect.score()` function. `args.grid` vector or matrix: arguments' grid consisting of sets of parameter values. A vector of values (for a single parameter) or a matrix (for multiple parameters). `args.names` character list; arguments' names. Default option `args.names = NULL` uses column names from `args.grid` `ordered` logical: whether results should be ordered (cases with worst power rate or highest total cost are on top). `ncase` integer: number of cases to be subsetted, ignored if `ordered = FALSE`.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12``` ```design <- cosa.crd2(order = 0, round = FALSE, constrain = "power", power = .80, cn1 = c(20, 10), cn2 = c(200, 50), es = .25, rho2 = .10, g2 = 3, r22 = .30, n1 = NULL, n2 = NULL, p = NULL) args.grid <- expand.grid( rho2 = seq(.15, .25, .05) ) vectorize.cosa(design, args.grid = args.grid, ordered = FALSE) ```

metinbulus/cosa documentation built on Sept. 9, 2021, 12:04 p.m.