Learn R Programming

equate (version 2.0.8)

px: Percentile Ranks and Cumulative Frequencies

Description

These functions compute percentile ranks and cumulative frequency distributions for frequency tables.

Usage

px(x, ...)

# S3 method for default px(x, y, ys, ...)

# S3 method for freqtab px(x, margin = 1, y, ymargin = 1, ...)

fx(x, ...)

# S3 method for default fx(x, ...)

# S3 method for freqtab fx(x, margin = 1, ...)

Arguments

x

either a vector of counts, or an object of class “freqtab” from which counts will be taken.

further arguments passed to or from other methods.

y

an object of class “freqtab” when x is as well, otherwise, a vector or data.frame of counts. See below for details.

ys

vector specifying the y score scale, when it is not contained in the first column of y. If y can be converted to a data.frame, it is assumed to be univariate with the first column containing the score scale and the second containing the counts.

margin, ymargin

integers specifying the margins for which frequencies or percentile ranks will be returned. margin applies to x and ymargin to y.

Value

A vector is returned containing either percentile ranks or cumulative frequencies with length equal to length(x).

Details

These functions compute percentile ranks and cumulative frequencies for a univariate distribution, and percentile ranks from one univariate distribution (x) corresponding to score values in another (y).

See Also

freqtab

Examples

Run this code
# NOT RUN {
x <- as.freqtab(ACTmath[, 1:2], drop = TRUE)
y <- as.freqtab(ACTmath[, c(1, 3)], drop = TRUE)

# Percentile ranks for the x scale
round(px(x), 3)

# Percentile ranks in y for x each score
round(px(x, y = y), 3)

# Cumulative frequency distribution for x
round(fx(x), 3)

# }

Run the code above in your browser using DataLab