| collect_weights | R Documentation |
Extract the data with the computed weights
collect_weights(
object,
drop_zero = TRUE,
keep_intermediate = FALSE,
weight_name = ".weight"
)
object |
a prepped object (output of prep()). |
drop_zero |
logical. If TRUE, drops rows with final weight 0 (ineligible / nonresponse). Default TRUE. |
keep_intermediate |
logical. If TRUE, adds one column per stage. |
weight_name |
name of the final weight column. Default ".weight". |
data.frame.
fitted <- weighting_spec(sample_survey, base_weights = pw) |>
step_nonresponse(respondent = responded, method = "weighting_class", by = "region") |>
prep()
head(collect_weights(fitted))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.