Weighted Median
Weighted population median.
weighted_median(x, w, na.rm = FALSE)
x
: [numeric vector]
data.w
: [numeric vector]
weights (same length as x
).na.rm
: [logical]
indicating whether NA
values should be removed before the computation proceeds (default: FALSE
).Weighted sample median; see weighted_quantile
for more information.
Weighted estimate of the population median
Overview (of all implemented functions)
weighted_quantile
head(workplace) weighted_median(workplace$employment, workplace$weight)
Useful links