weighted.rank {cNORM} | R Documentation |
Conducts weighted ranking on the basis of the weighted Harrell-Davis quantile estimator
weighted.rank(x, weights = NULL, n = 1000, type = "Type7")
x |
A numerical vector |
weights |
A numerical vector with weights; should have the same length as x |
n |
Granularity for approximation |
type |
Type of estimator, can either be "Harrell-Davis" using a beta function to approximate the weighted percentiles (Harrell & Davis, 1982) or "Type7" (default; Hyndman & Fan, 1996), an adaption of the generic quantile function in R, including weighting. All code based on the work of Akinshin (2020). |
the weighted ranks
Harrell, F.E. & Davis, C.E. (1982). A new distribution-free quantile estimator. Biometrika, 69(3), 635-640.
Hyndman, R. J. & Fan, Y. 1996. Sample quantiles in statistical packages, American Statistician 50, 361–365.
Akinshin, A. (2020). Weighted quantile estimators. https://aakinshin.net/posts/weighted-quantiles/