A weighted cdf is calculated and quantiles are evaluated. Missing values are discarded.
Usage
weighted.quantile(x, w, prob = 0.5, plot = FALSE)
Value
The quantile according to prob (by default it returns the weighted median).
Arguments
x
a vector of data.
w
a vector of (sampling) weights.
prob
the probability for the quantile.
plot
if TRUE, the weighted cdf is plotted.
Author
Beat Hulliger
Details
Weighted linear interpolation in case of non-unique inverse. Gives a warning when the
contribution of the weight of the smallest observation to the total weight is larger
than prob.