median_w {wbacon}R Documentation

Weighted Median

Description

median_w computes the weighted population median.

Usage

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

Arguments

x

[numeric vector] observations.

w

[numeric vector] weights (same length as vector x).

na.rm

[logical] indicating whether NA values should be removed before the computation proceeds (default: FALSE).

Details

Weighted sample median; see quantile_w for more information.

Value

Weighted estimate of the population median.

See Also

quantile_w


[Package wbacon version 0.6-1 Index]