Skip to contents

Returns weighting targets for survey objects.

Usage

create_targets(target_design, target_formula)

Arguments

target_design

A survey object

target_formula

A formula object that contains the variables to weight on

Value

Weighting target for survey objects

Examples

data(poll.data)
poll.svy = survey::svydesign(ids = ~ 1,
                     data = poll.data)
#> Warning: No weights or probabilities supplied, assuming equal probability

#Set up raking formula:
formula_rake = ~ age_buckets + educ + gender + race + educ * pid + bornagain

#Generate targets:
targets_rake = create_targets(poll.svy, formula_rake)