process_qs: Process the desired sample sizes for 'optimize_controls()'

Description Usage Arguments Value

View source: R/verify_optimize_controls_inputs.R

Description

Processes the inputs to optimize_controls() to formulate sample size constraints.

Usage

1
process_qs(ratio, q_s, n_s, treated, k, group, st_vals, stratios)

Arguments

ratio

a numeric or vector specifying the desired ratio of controls to 'treated' in each stratum. If there is one control group and all treated units should be included, this can be a numeric. Otherwise, this should be a vector with one entry per treatment group, in the same order as the levels of z, including the treated level. If NULL, q_s should be specified.

q_s

a named vector or matrix indicating how many units are to be selected from each stratum. If there is one control group and all treated units are desired, this can be a vector; otherwise, this should have one row per treatment group, where the order of the rows matches the order of the levels of z, including the treated level. If NULL, ratio should be specified. If both are specified, q_s will take priority. Typically, if the desired ratio is not feasible for every stratum, q_s should be generated using generate_qs().

treated

which treatment value should be considered the treated units. This must be one of the values of z.

Value

A matrix of sample sizes for each treatment and stratum.


natstrat documentation built on Oct. 15, 2021, 5:12 p.m.