powered by
Calculates the weighted variance
var_wt(x, wt, na.rm = FALSE)
A numeric vector containing weighted variance of the elements of x
x
numeric vector
weights
If TRUE, indices where x is NA will be removed
TRUE
x <- sample(1:10, size = 10, replace = TRUE) x.weight <- seq(0, 1, length.out = 10) var_wt(x, wt = x.weight)
Run the code above in your browser using DataLab