wquant | R Documentation |
Estimate weighted quantiles.
wquant(
x,
weights = rep(1, length(x)),
probs = c(`0%` = 0, `25%` = 0.25, `50%` = 0.5, `75%` = 0.75, `100%` = 1)
)
x |
numeric; a vector of data. |
weights |
numeric; vector of weights. |
probs |
numeric; desired quantiles. |
wquant
estimates quantiles of weighted data using the estimator of Harrell & Davis (1982), with improvements recommended by Andrey Akinshin (2023).
wquant
returns a vector containing the estimated quantiles.
If probs
has names, these are inherited.
Aaron A. King
1982
\Akinshin2023
x <- c(1,1,1,2,2,3,3,3,3,4,5,5,6,6,6)
quantile(x)
wquant(x)
wquant(c(1,2,3,4,5,6),weights=c(3,2,4,1,2,3))
wquant(c(1,2,3,4,5),c(1,0,0,1,1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.