hd_qe: Harrell-Davis quantile estimator with trimming proposed by...

hd_qeR Documentation

Harrell-Davis quantile estimator with trimming proposed by Akinshin.

Description

Function to compute the Harrell-Davis estimate for any specified quantile(s). Trimming of the values is also integrated to incrase the robustness of the estimator to outlier values.

Usage

hd_qe(
	x,
	q = 0.5,
  na.rm = TRUE,
  trim = 0.01)

Arguments

x

A vector of continuous observations.

q

Quantile(s) between 0 and 1 - default is 0.5, the median..

na.rm

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

trim

Proportion of trimming to do. Default is 0.01 - 1 percent of both tails of the distribution.

Details

hd_qe 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. This function is taken in part from the from the rogme package by Guillaume Rousselet (https://github.com/GRousselet/rogme/, which in turn is based on Rand Wilcox's WRS package - https://github.com/nicebread/WRS/). The function incorporates suggestions to improve the robustness of the Harrell-Davis estimatorby adding in the ability to trim observed values, based (loosely) on the suggestions of Andrey Akinshin in a series of blogs - see https://aakinshin.net/posts/winsorized-hdqe/ and linked posts.

Value

Function returns a quantile estimate (numeric) vector of length q.

Author(s)

Adam Van Iwaarden avaniwaarden@nciea.org

Examples

	## Not run: 
		###  require(SGPdata)
		hd_qe(
  			x = sgpData_LONG_COVID[
					      YEAR=="2019" &
								CONTENT_AREA=="ELA" &
								GRADE=="3", SCALE_SCORE],
  			q = 1:9/10)
	
## End(Not run)

CenterForAssessment/cfaTools documentation built on June 2, 2022, 9:23 a.m.