Computes a weighted quantiles of a vector or matrix. Based on the formula in Wikipedia (see the vignette) which is one of many ways to compute weighted quantiles.
weighted_quantile(x, w, probs = probs, na.rm)
A weighted variance.
A numeric vector or matrix. For matrix, the quantiles are computed for each column.
A numeric vector of non-negative weights. Will be automatically normalised to sum to one.
A numeric vector of probabilities with values between 0 and 1.
If TRUE
, NA
and NaN
values in x
(and corresponding weights in w
) are omitted from the computation.
Default is FALSE
. Additional missing values in w
are not
allowed.