Learn R Programming

distrr (version 0.0.6)

wq: Empirical weighted quantile

Description

Empirical weighted quantile

Usage

wq(x, weights, probs = c(0.5))

Arguments

x

A numeric vector

weights

A vector of (positive) sample weights

probs

a numeric vector with the desired quantile levels (default 0.5, the median)

Value

The weighted quantile (a numeric vector)

References

Ferrez, J., Graf, M. (2007). Enqu<U+00E8>te suisse sur la structure des salaires. Programmes R pour l'intervalle de confiance de la m<U+00E9>diane. (Rapport de m<U+00E9>thodes No. 338-0045). Neuch<U+00E2>tel: Office f<U+00E9>d<U+00E9>ral de statistique.

Examples

Run this code
# NOT RUN {
wq(x = rnorm(100), weights = runif(100))
# }

Run the code above in your browser using DataLab