Description Usage Arguments Value
This linear program is used by optimize_controls()
to choose which controls
to select.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | balance_LP(
z,
X,
importances,
st,
st_vals,
S,
q_s,
N,
solver,
integer,
time_limit,
threads = 1,
weight_comp = 1
)
|
z |
a factor with the |
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 |
st |
a stratum vector with the |
st_vals |
the unique stratum levels contained in |
S |
the number of unique stratum levels contained in |
q_s |
a named vector or matrix indicating how many control 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 |
N |
the total number of available controls in the data. |
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. |
integer |
a logical stating whether to use a mixed integer programming solver
instead of randomized rounding. Default is |
time_limit |
numeric stating maximum amount of seconds for which the
program is allowed to run before aborting. Default is |
threads |
The maximum number of threads that should be used. This is only
applicable if |
A list containing two elements:
lpdetails
The output of either gurobi()
or Rglpk_solve_LP()
,
except that if gurobi()
is used, the elements objval
and x
are renamed optimum
and solution
to be consistent with the output of Rglpk_solve_LP()
.
o
The original output of either gurobi()
or Rglpk_solve_LP()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.