weightedMedian {laeken} | R Documentation |
Weighted median
Description
Compute the weighted median (Eurostat definition).
Usage
weightedMedian(x, weights = NULL, sorted = FALSE, na.rm = FALSE)
Arguments
x |
a numeric vector. |
weights |
an optional numeric vector giving the sample weights. |
sorted |
a logical indicating whether the observations in |
na.rm |
a logical indicating whether missing values in |
Details
The implementation strictly follows the Eurostat definition.
Value
The weighted median of values in x
is returned.
Author(s)
Andreas Alfons and Matthias Templ
References
Working group on Statistics on Income and Living Conditions (2004) Common cross-sectional EU indicators based on EU-SILC; the gender pay gap. EU-SILC 131-rev/04, Eurostat.
See Also
arpt
, incMedian
,
weightedQuantile
Examples
data(eusilc)
weightedMedian(eusilc$eqIncome, eusilc$rb050)
[Package laeken version 0.5.3 Index]