Learn R Programming

equate (version 1.1-3)

freqtab: Frequency Tabulation

Description

freqtab creates a frequency table for a vector, or vectors, of scores. as.freqtab converts to class freqtab

Usage

freqtab(xscale, x, vscale, v)
as.freqtab(xscale, x)

Arguments

xscale
the score scale for form X, as a vector
x
vector of scores (one per examinee) on items in form X (see details for other options)
vscale
the score scale for form V, as a vector
v
vector of scores (one per examinee) for form X examinees on items in form V (i.e., the anchor test)

Value

  • In the univariate case (i.e., form V is not specified) a two-column matrix is returned, where column 1 contains the score scale and column 2 the frequency for each scale value. In the bivariate case a three-column matrix is returned where columns 1 and 2 contain all combinations of form X score scale points (in column 1) and score scale points on the anchor test (in column 2), and column 3 contains the total number of examinees obtaining the corresponding score combination.

Details

If x is a vector of scores, one per examinee, values are factored with levels = xscale. This ensures that unobtained scores (i.e., scores not in x) will still be represented in the tabulation. If x is a two-column matrix, as.freqtab serves to simply change its class to freqtab, as required by equate. In this case the first column should contain the score scale and the second column the number of examinees obtaining each score. Alternatively, both xscale and x can be included in as.freqtab, with the same result.

See Also

table

Examples

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

x2 <- ACTmath[, 2]
x2scale <- ACTmath[, 1]
as.freqtab(x2scale, x2)

xscale <- 0:36
vscale <- 0:12
freqtab(xscale, KBneat$x[, 1],
  vscale, KBneat$x[, 2])

Run the code above in your browser using DataLab