randomized_rounding {natstrat} | R Documentation |
Sample integer solution from linear programming solution with correct sample sizes
Description
The linear programming solution of balance_LP()
that is used
within optimize_controls()
sometimes selects fractional units.
Here, we select any unit the linear programming solution chose with coefficient 1.
Then, we select the remaining required number of units from those that have
fractional solutions by sampling with probabilities equal to the linear
programming solution and fixed sample size. Used within optimize_controls()
if correct_sizes = TRUE
.
Usage
randomized_rounding(o, N, st, st_vals, S, z)
Arguments
o |
linear programming results, as found in the 'o' element of the
returned list from |
N |
the total number of available controls in the data. |
st |
a stratum vector with the |
st_vals |
the unique stratum levels contained in |
S |
the number of unique stratum levels contained in |
z |
a factor with the |
Value
Dataframe with two columns: pr
, which contains
the coefficient determined for that unit from the linear programming
solution, and select
, a boolean vector stating whether that
unit was selected for inclusion by randomized rounding.