View source: R/percentile_rank.R
| percentile_rank | R Documentation |
Converts a vector of measurements into percentile ranks,
(\bar{r} - 1/2) / k, where \bar{r} is the average rank (ties
share the mean of the ranks they span) and k is the number of
measurements ranked. This is the rank scale on which the agreement check of
rank_contrasts() compares Jensen-Shannon distance with Pillai:
a difference of 0.25 means the two measures place a speaker a quarter of the
ordering apart. Ranks are ascending, so larger values of x receive
larger percentile ranks. Measurements that are NA or flagged in
exclude are left out of the ranking (they do not count toward
k) and come back as NA.
percentile_rank(x, exclude = NULL)
x |
Numeric vector of measurements to rank. |
exclude |
Optional logical vector the same length as |
Numeric vector the same length as x with percentile ranks in
(0, 1) for the ranked measurements and NA elsewhere.
percentile_rank(c(0.2, 0.5, 0.5, 0.9))
percentile_rank(c(0.2, 0.5, 0.5, 0.995), exclude = c(0.2, 0.5, 0.5, 0.995) >= 0.99)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.