verify_multi_comp_inputs: Verify the inputs for supplemental comparisons to...

Description Usage Arguments Value

View source: R/verify_optimize_controls_inputs.R

Description

Makes sure that the inputs for supplemental comparisons to optimize_controls() are in the correct format and feasible.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
verify_multi_comp_inputs(
  q_s,
  q_star_s,
  n_s,
  treated,
  treated_star,
  weight_star,
  group,
  correct_sizes
)

Arguments

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().

q_star_s

a named vector or matrix, indicating how many supplemental units are to be selected from each stratum. The matrix 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 multiple supplemental comparisons are desired, this should be a list with one entry per supplemental comparison.

treated

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

treated_star

which treatment value should be considered the treated units for the supplemental comparison. This must be one of the values of z. If multiple supplemental comparisons are desired, this should be a vector with one entry per supplemental comparison.

weight_star

a numeric stating how much to prioritize balance between the supplemental units as compared to balance between the main units. If multiple supplemental comparisons are desired, this should be a vector with one entry per supplemental comparison.

correct_sizes

boolean stating whether the desired sample sizes should be exactly correct (if correct_sizes = TRUE) or only need to be correct in expectation. For multiple comparisons, sample sizes may only be correct in expectation.

Value

No return value. If there is a problem with the inputs to optimize_controls(), an error is raised.


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