wtd.quantile {reldist} | R Documentation |
Weighted Quantiles
Description
Compute weighted quantile
Usage
wtd.quantile (x, q=0.5, na.rm = FALSE, weight=NULL)
Arguments
x |
Vector of data, same length as |
q |
Quantile to compute |
na.rm |
Logical: Should NAs be stripped before computation proceeds? |
weight |
Vector of weights. If NULL, the default, weights are not used. |
Details
Uses a simple algorithm based on sorting.
Value
Returns an empirical q quantile from a weighted sample.
[Package reldist version 1.7-2 Index]