Learn R Programming

anesrake (version 0.80)

discrep: Function to determine the discrepancy for each level of a variable from targets.

Description

Finds the discrepancy between the proportion of data in each level of a weighted vector and a set of targets for each level of that same vector. Used as part of anesrake.

Usage

discrep(datavec, targetvec, weightvec)

Arguments

datavec

Vector of values for a particular variable.

targetvec

Vector of targets with a single item per level of that variable.

weightvec

Weighting vector to be applied to datavec.

Value

Vector of discrepancies at each level.