This function weights the variable var by
a specific vector of weights. It's an
alternative weight calculation to weight,
though weight usage is recommended.
This function sums up all weights values of the associated
categories of var, whereas the weight function
uses a xtabs formula to weight cases. Thus, this function
may return a vector of different length than var.
Usage
weight2(var, weights)
Arguments
var
The (unweighted) variable
weights
A vector with same length as var, which
contains weight factors. Each value of var has a
specific assigned weight in weights.