powered by
Computes a weighted median of a numeric vector
weighted.median(y, w)
A numeric vector containing the values whose median is to be computed
A vector of length y giving the weights to use for each element of y
y
weighted.mean, weighted.fractile
weighted.mean
weighted.fractile
y <- 1:9 w <- c(rep(1,5), rep(2,4)) res <- weighted.median(y, w)
Run the code above in your browser using DataLab