weighted_median: Weighted Median

View source: R/weighted_median.R

weighted_medianR Documentation

Weighted Median

Description

Weighted population median.

Usage

weighted_median(x, w, na.rm = FALSE)

Arguments

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).

Details

Weighted sample median; see weighted_quantile for more information.

Value

Weighted estimate of the population median

See Also

Overview (of all implemented functions)

weighted_quantile

Examples

data(workplace)

weighted_median(workplace$employment, workplace$weight)

robsurvey documentation built on Jan. 6, 2023, 5:09 p.m.