wquantile | R Documentation |
Functions to compute weighted quantiles and the weighted interquartile range.
wquantile(wt = rep(1,length(x)), x, probs, already.sorted = FALSE, already.normalized = FALSE) wIQR(wt = rep(1,length(x)), x, already.sorted = FALSE, already.normalized = FALSE)
wt |
Vector of weights |
x |
Vector of data, same length as |
probs |
Numeric vector of probabilities with values in [0,1]. |
already.sorted |
If FALSE, sort |
already.normalized |
If FALSE, normalize |
wquantile
uses the findInterval
function. wIQR
calls the wquantile
function.
Returns the sample quantiles or interquartile range of a discrete distribution with
support points x
and corresponding probability masses wt
npEM
IQR(1:10) wIQR(x=1:10) # Note: Different algorithm than IQR function wIQR(1:10,1:10) # Weighted quartiles are now 4 and 8
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.