hdqe: Harrell-Davis Quantile Estimator

View source: R/hdqe.R

hdqeR Documentation

Harrell-Davis Quantile Estimator

Description

Computes the Harrell-Davis quantile estimator for given quantile levels.

Usage

hdqe(x, Q = c(0.25, 0.5, 0.75))

Arguments

x

Numeric vector of data values.

Q

A numeric vector of quantile levels to estimate, between 0 and 1. Defaults to c(0.25, 0.5, 0.75) for the 25th, 50th, and 75th percentiles (Q1, Q2, Q3).

Details

The function computes the Harrell-Davis quantile estimator, which estimates data quantiles by calculating a weighted average of order statistics. The weights are based on the beta distribution.

Value

A numeric vector containing estimated quantiles.

Author(s)

Zeynel Cebeci, A. Firat Ozdemir, Engin Yildiztepe

Examples

set.seed(1)
x <- sample(1:10, 50, replace=TRUE)
quantile(x, probs=c(0.25, 0.5, 0.75), type=1) # quantiles with Type 1 in stats::quantile
quantile(x, probs=c(0.25, 0.5, 0.75), type=7) # quantiles with Type 7 (default) in stats::quantile
hdqe(x, Q=c(0.25, 0.5, 0.75)) # quantiles with Harrell-Davis Estimator

groupcompare documentation built on June 26, 2025, 1:08 a.m.