View source: R/helper_functions.R
create_targets | R Documentation |
Returns weighting targets for survey objects.
create_targets(target_design, target_formula)
target_design |
A survey object |
target_formula |
A formula object that contains the variables to weight on |
Weighting target for survey objects
data(poll.data)
poll.svy = survey::svydesign(ids = ~ 1,
data = poll.data)
#Set up raking formula:
formula_rake = ~ age_buckets + educ + gender + race + educ * pid + bornagain
#Generate targets:
targets_rake = create_targets(poll.svy, formula_rake)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.