wq: Estimates empirical weighted quantile

View source: R/AA_utils.R

wqR Documentation

Estimates empirical weighted quantile

Description

Estimates 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ête suisse sur la structure des salaires. Programmes R pour l'intervalle de confiance de la médiane. (Rapport de méthodes No. 338-0045) . Neuchâtel: Office fédéral de la statistique.

Examples

wq(x = rnorm(100), weights = runif(100))

gibonet/decr documentation built on Jan. 5, 2024, 7:26 a.m.