hd_qe | R Documentation |
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.
hd_qe(
x,
q = 0.5,
na.rm = TRUE,
trim = 0.01)
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. |
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.
Function returns a quantile estimate (numeric) vector of length q
.
Adam Van Iwaarden avaniwaarden@nciea.org
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.