rk_rake.Rd
A convenience function wrapping rk_weight()
and rk_extract()
or
rk_weight()
and rk_integerise()
rk_rake(cons, inds, vars, output = "fraction", iterations = 10, ...)
cons | A data frame of constraint variables |
---|---|
inds | A data frame of individual--level (survey) data |
vars | A character string of variables to iterate over |
output | A string specifying the desired output, either "fraction" (rk_extract()) or "integer" (rk_integerise()) |
iterations | The number of iterations to perform. Defaults to 10. |
... | Additional arguments to pass to depending on desired output:
|
A data frame with extracted weights (if output == "fraction", the default) or integerised cases (if output == "integer")
# NOT RUN { frac_weights <- rake(cons, inds, vars, output = "fraction", id = "id") int_weight <- rake(cons, inds, vars, output = "integer", method = "trs", seed = "42") # }