Predefined functions for weighted point estimates in package surveysd
.
weightedRatio(x, w) weightedSum(x, w)
x | numeric vector |
---|---|
w | weight vector |
Each of the functions return a single numeric value
Predefined functions are weighted ratio and weighted sum.
x <- 1:10 w <- 10:1 weightedRatio(x,w)#> [1] 18.18182x <- 1:10 w <- 10:1 weightedSum(x,w)#> [1] 220