| step_rescale | R Documentation |
Rescale (normalize) the weights
step_rescale(spec, to = c("n", "total"), total = NULL, by = NULL)
spec |
a weighting_spec. |
to |
"n" (weights sum to the number of active units, i.e. mean weight 1)
or "total" (weights sum to |
total |
numeric. Target sum when to = "total". |
by |
character. Rescale within these groups (optional). With to = "n", each group sums to its own active count. |
The input weighting_spec with this step appended to its recipe. The
step is recorded only; it is evaluated when prep() is called.
weighting_spec(sample_survey, base_weights = pw) |>
step_rescale(to = "n") |> prep()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.