LowerSum {wINEQ} | R Documentation |
Computes weighted sum of values not greater then a quantile derived for the given probability.
LowerSum(X, W = rep(1, length(X)), p = 0.5)
X |
is a numeric data vector |
W |
is a vector of weights |
p |
is a probability to derive corresponding quantile |
Calculates weighted sum of values not greater then a quantile derived for the given probability based on cumulative distribution. Linear interpolation is applied to deal with a frequency distribution.
The weighted sum of values not greater then a quantile.
# Suppose X represents incomes. Compare total incomes with incomes of poorer half of population.
X=1:10
W=10:1
sum(W*X)
LowerSum(X,W,0.5)