do_rake | R Documentation |
This function performs iterative raking as described in DeBell and Krosnick
(2009). It is a private function and not intended for end-users. End-users
should call harvest
to add weights.
do_rake(data, target, weights, max_weight, max_iterations, convergence,
enforce_mean = TRUE, verbose)
data |
The data frame (tibble) or matrix containing the original data |
target |
The target proportions, specified as in |
weights |
A numeric vector of current weights |
max_weight |
The maximum weight to clamp weights to after raking each variable |
max_iterations |
The maximum number of iterations of raking to perform
before giving up. Please note that depending on the variable selection
method, |
convergence |
Convergence parameters as described in
|
enforce_mean |
Default TRUE. By default, weights minimize divergence
from target proportions subject to two conditions: that the mean weight
be 1, and that the maximum weight be capped at |
verbose |
Level of verbosity, defaults to FALSE. At TRUE or 1, the function begins emitting progress information during major events. At 2, each iteration provides progress information. |
A numeric vector of adjusted, raked weights.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.