wtdVar {eatTools} | R Documentation |
Computed weighted variance
Description
This functions works quite equally as the wtd.var
function
from the Hmisc
package.
Usage
wtdVar(x , weights , na.rm = FALSE)
Arguments
x |
numeric vector |
weights |
a numeric vector of non-negative weights |
na.rm |
set to |
Value
a scalar
Author(s)
Benjamin Becker
Examples
x <- c(50, 1, 25)
w <- c(1, 4, 1)
wtdVar(x, w)
[Package eatTools version 0.7.6 Index]