percentile_rank: Percentile rank

View source: R/stats.R

percentile_rankR Documentation

Percentile rank

Description

The bounds of a percentile rank are > 0 and < 100.

A percentile rank here is the proportion of scores that are less than the current score.

PR = (c_L + 0.5 f_i) / N * 100

Where

c_L is the frequency of scores less than the score of interest

f_i is the frequency of the score of interest

Usage

percentile_rank(x)

Arguments

x

A vector of values to rank

Details

Computes a percentile rank for each score in a set.

Value

A percentile rank between 0 and 100

Examples

percentile_rank(0:9)
x <- c(1, 1, 2, 5, 7, NA_integer_, 7, 10)
percentile_rank(x)
# compare to dplyr
# dplyr::percent_rank(x) * 100

jmbarbone/jordanExtra documentation built on Aug. 4, 2023, 5:37 p.m.