Skip to contents

Unrolls the cascade into a data.frame: the weight of every unit at every stage, plus the factor each step applied to it. This is the tidy form of prep()'s $history, and the starting point for any diagnostic that plot() does not already draw.

Usage

weight_factors(object)

Arguments

object

a prepped object (output of prep()).

Value

data.frame with one weight column per stage and one factor per step.

Examples

fitted <- weighting_spec(sample_survey, base_weights = pw) |>
  step_nonresponse(respondent = responded, method = "weighting_class", by = "region") |>
  prep()
head(weight_factors(fitted))
#>   base stage_1_step_nonresponse factor_stage_1_step_nonresponse
#> 1 12.5                 19.07051                        1.525641
#> 2 12.5                  0.00000                        0.000000
#> 3 12.5                  0.00000                        0.000000
#> 4 12.5                  0.00000                        0.000000
#> 5 12.5                 19.07051                        1.525641
#> 6 12.5                 19.07051                        1.525641