weighted.quant: Weighted quantile

View source: R/weighted_quantile.R

weighted.quantR Documentation

Weighted quantile

Description

Computes weighted quantiles of a numeric vector.

Usage

weighted.quant(x, w = rep(1, length(x)), q = 0.5)

Arguments

x

(numeric vector) Variable of interest for which to compute the quantile

w

(numeric vector) Vector with the weights

q

(numeric vector) A number between 0 and less than 1 indicating the desired quantile

Value

Scalar containing the quantile

Examples

weighted.quant(x = mtcars$mpg, w = mtcars$wt,  q = seq(.1,.9,.1))


Rrepest documentation built on April 4, 2025, 2:07 a.m.