Learn R Programming

equate (version 0.1-0)

freqtab: Frequency Tabulation

Description

This function creates a frequency table for a vector of scores.

Usage

freqtab(x, scale)

Arguments

x
vector of scores either of length greater than length(scale), where each value represents an examinee total score, or of length equal to length(scale), where each value is already a score frequency (see below for details)
scale
the score scale, as a vector

Value

  • Returns a 2-column matrix, where column 1 contains the score scale and column 2 the frequency for each scale value

Details

If x is a vector of total scores, values are factored with levels = scale. This ensures that unobtained scores (i.e., scores not in x) will still be represented in the tabulation. If x is a vector of frequencies, with one value for each scale point provided in scale, the function serves to simply change the class of x to freqtab.

See Also

table

Examples

Run this code
set.seed(2005)
x1 <- round(rnorm(100,100,10))
x1scale <- 1:100
freqtab(x1,x1scale)

x2 <- round(rnorm(1000,100,10))
x2scale <- 70:130
freqtab(x2,x2scale)

x3scale <- ACTmath[,1]
x3 <- ACTmath[,2]
freqtab(x3,x3scale)

Run the code above in your browser using DataLab