weighted.median: Weighted Median

weighted.medianR Documentation

Weighted Median

Description

Computes a weighted median of a numeric vector

Usage

weighted.median(y, w)

Arguments

y

A numeric vector containing the values whose median is to be computed

w

A vector of length y giving the weights to use for each element of y

See Also

weighted.mean, weighted.fractile

Examples

y <- 1:9
w <- c(rep(1,5), rep(2,4))
res <- weighted.median(y, w)

isotone documentation built on March 7, 2023, 6:58 p.m.