weighted.iqr | R Documentation |
Computes the weighted inter-quantile range of a numeric vector.
weighted.iqr(x, w = rep(1, length(x)), rang = c(0.25, 0.75))
x |
(numeric vector) Variable of interest for which to compute the inter-quantile range |
w |
(numeric vector) Vector with the weights |
rang |
(numeric vector) Two numbers between 0 and 1 indicating the desired inter-quantile range |
Scalar containing the inter-quantile range
weighted.iqr(x = mtcars$mpg, w = mtcars$wt, rang = c(.5,.9))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.