Skip to contents

Prepares survey or PUMS targets for weighting, expanding target configs and handling day-of-week suffixes. Use as the main entry for target tabulation.

Usage

prepare_targets(
  households = NULL,
  persons = NULL,
  codebook,
  settings,
  target_names = NULL
)

Arguments

households

data.table. Household data.

persons

data.table. Person data.

codebook

data.table. Codebook data.

settings

list. Settings object with target configs.

target_names

character vector, optional. Target names to prepare.

Value

data.table. Prepared targets, seed, or control totals.

Details

  • Expands target configs for day-of-week and crosstab targets.

  • Tabulates targets by method specified in settings.

  • Handles survey and PUMS input fields.

  • Skips targets with missing input or 'skip' config.

  • Returns data.table of targets, seed, or control totals.

  • Assumes input tables are data.table and settings are complete.

Settings

Uses all target configs and weight_dow_groups.

Examples

## Not run:
prepare_targets(households, persons, codebook, settings)
#> Error: object 'households' not found