| wpct {weights} | R Documentation |
wpct produces a weighted table of the proportion of data in each category for any variable. This is simply a weighted frequency table divided by its sum.
wpct(x, weight=NULL, na.rm=TRUE, ...)
x |
|
weight |
|
na.rm |
If |
... |
|
A table object of length equal to the number of separate values of x.
Josh Pasek, Assistant Professor of Communication Studies at the University of Michigan (www.joshpasek.com).
test <- c(1,1,1,1,1,1,2,2,2,3,3,3,4,4) weight <- c(.5,.5,.5,.5,.5,1,1,1,1,2,2,2,2,2) wpct(test) wpct(test, weight)