wpct {weights} | R Documentation |
Provides a weighted table of percentages for any variable.
Description
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.
Usage
wpct(x, weight=NULL, na.rm=TRUE, ...)
Arguments
x |
|
weight |
|
na.rm |
If |
... |
|
Value
A table object of length equal to the number of separate values of x
.
Author(s)
Josh Pasek, Assistant Professor of Communication Studies at the University of Michigan (www.joshpasek.com).
Examples
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)
[Package weights version 1.0.4 Index]