dem.weight: Applies ipf weighting for each day. Input is dem and rims....

Description Usage Details

View source: R/weighting.r

Description

dem is expected to contain columns 'day', 'pin', 'guest', 'hw', and all rims. Pin has to represent individuals (weigth are individuals). Ipf will run without guests, guests get the weigth of the hw in the correspondinh household.

Usage

1
dem.weight(dem, rims, crit = 0.5)

Details

rims is a named list of n data.frames (or data.tables) each representing a weighting rim. A rim contains the population margins as the last column. Other columns may give the labels for each weigthin cell. Each rim has to sum up to the same total. The order of rims as well as the order of each rim's cells matters.

rim names as well as each rim's levels (numeric or string labels) have to match exactly between rims and dem.


rluech/tv-clone documentation built on Jan. 7, 2022, 12:27 a.m.