weighted.quant {Rrepest}R 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))


[Package Rrepest version 1.5.4 Index]