optimize_controls()Processes the inputs to optimize_controls() to formulate sample size constraints.
process_qs(ratio, q_s, n_s, treated, k, group, st_vals, stratios)A matrix of sample sizes for each treatment and stratum.
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.
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().
which treatment value should be considered the treated units. This
must be one of the values of z.