Learn R Programming

isotone (version 1.0-1)

weighted.fractile: Weighted Median

Description

Computes the weighted fractile of a numeric vector

Usage

weighted.fractile(y, w, p)

Arguments

y
A numeric vector containing the values whose fractile is to be computed
w
A vector of length y giving the weights to use for each element of y
p
Fractile specification; value between 0 and 1

See Also

weighted.mean, weighted.median

Examples

Run this code
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