| step_round | R Documentation |
Optional step, typically the last one (after calibration). Simple rounding ("nearest") slightly breaks the calibrated totals; "preserve_total" uses the largest-remainder method to keep the exact total.
step_round(spec, digits = 0L, method = c("nearest", "preserve_total"))
spec |
a weighting_spec. |
digits |
integer. Decimals to keep (0 = integers). |
method |
"nearest" (simple rounding) or "preserve_total" (keeps the sum of weights). Note: "preserve_total" can break equality of weights within a cluster; if you need integer and equal weights per household, use "nearest". |
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_round(digits = 0) |> prep()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.