hd: Harrell-Davis quantile estimator

View source: R/stats.R

hdR Documentation

Harrell-Davis quantile estimator

Description

Compute the Harrell-Davis estimate of the qth quantile.

Usage

hd(x, q = 0.5, na.rm = TRUE)

Arguments

x

A vector of continuous observations.

q

A quantile between 0 and 1 - default is 0.5, the median.

na.rm

Set to TRUE to remove NA, FALSE otherwise - default is TRUE.

Details

hd is a weighted average of all the order statistics. See https://garstats.wordpress.com/2016/06/09/the-harrell-davis-quantile-estimator/ for more details.

Note

code from Rallfun-v33.txt. See https://github.com/nicebread/WRS/

References

Harrell, F.E. & Davis, C.E. (1982) A new distribution-free quantile estimator. Biometrika, 69, 635-640.

Examples

hd(x) # use default estimation of the median (q = 0.5)
hd(x, q = 0.25) # estimate the first quartile
hd(x, q = 0.75) # estimate the third quartile

GRousselet/rogme documentation built on Nov. 12, 2022, 4:38 a.m.