perc_rank: Percentile Ranks

View source: R/scoring.R

perc_rankR Documentation

Percentile Ranks

Description

Calculate the percentile rank corresponding to a breakpoint.

Usage

perc_rank(x, breaks, fun = "<=", perc = TRUE, digits = 1,
    out.names = as.character(breaks))

Arguments

x

Numerical vector of observed data.

breaks

Cut-off values to use as breakpoints.

fun

Comparison function used to count the data.

perc

Logical. Convert the result in percentages.

digits

Number of decimals for output.

out.names

Names for the elements in the output vector (use NULL to exclude names).

Details

For each breakpoint, if fun = "<=", the function returns the percentage of data less than or equal to the break value. Otherwise, if fun = ">=", the function returns the percentage of data greater than or equal to the break value.

Examples

data("drive")
score <- rowSums(drive[,5:10])
perc_rank(score, seq(5,25,by=5))

DavideMassidda/testing documentation built on Oct. 12, 2023, 4:32 p.m.