LowerSum {wINEQ} | R Documentation |
Weighted lower sum
Description
Computes weighted sum of values not greater then a quantile derived for the given probability.
Usage
LowerSum(X, W = rep(1, length(X)), p = 0.5)
Arguments
X |
is a numeric data vector |
W |
is a vector of weights |
p |
is a probability to derive corresponding quantile |
Details
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.
Value
The weighted sum of values not greater then a quantile.
Examples
# 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)
[Package wINEQ version 1.2.1 Index]