| irank_against | R Documentation |
The method irank compares ranks using the same vector as reference.
irank_against returns integer ranks, that values from x would assume if (individually)
inserted into v. frank_against acts analogously, returning fractional ranks.
irank_against(x, v, omega = 0, increasing = FALSE, na.rm = FALSE)
frank_against(x, v, omega = 0, increasing = FALSE, na.rm = FALSE)
x |
numeric query vector. |
v |
numeric reference vector. |
omega |
numeric value in [0,1], defining how ties in |
increasing |
logical; if |
na.rm |
logical; if |
It's useful to think about frank_against(x,v) as a generalization of Empirical Cumulative
Distribution Function, created for v and evaluated for points in x.
frank_agaist(x,v,increasing=TRUE,omega=1) is identical
to ecdf(v)(x).
increasing switches the inequality sign in ECDF definition from
F_V(t) = \hat P(V <= t) to \hat P(V >= t).
omega=0 introduces the strict inequality (\hat P(V < t) instead of \hat P(V <= t)).
Any omega in between is a weighted average of the cases omega=1 and omega=0.
Finally, irank_against is equal to frank_against multiplied by the length(v).
This particular choice of default parameters was made for compatibility with default parameters of
irank and frank. irank(x) is always equal to irank_against(x,x) and frank(x) is always equal to frank_against(x,x).
Numeric vector of the same length as x containing the integer (for irank_against) or fractional (for frank_against) ranks.
irank(), ecdf()
irank_against(1:10, c(4,4,4,3,1,10,7,7))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.