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