Description Usage Arguments Value
View source: R/verify_optimize_controls_inputs.R
Makes sure that the inputs to optimize_controls()
are in the correct
format and feasible.
1 | verify_inputs(X, importances, ratio, q_s, st, z, treated, integer, solver)
|
X |
a matrix or data frame containing constraints in the columns. The number
of rows should equal the length of |
importances |
a vector with length equal to the number of constraints or columns
in |
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
|
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 |
st |
a stratum vector with the |
z |
a factor with the |
treated |
which treatment value should be considered the treated units. This
must be one of the values of |
integer |
a logical stating whether to use a mixed integer programming solver
instead of randomized rounding. Default is |
solver |
a character stating which solver to use to run the linear program. Options are "Rglpk" (default) or "gurobi". You must have the 'gurobi' package installed to use the "gurobi" option. If available, this is the recommended solver. |
No return value. If there is a problem with the inputs to optimize_controls()
,
an error is raised.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.