Learn R Programming

equate (version 1.2-0)

freqtab: Frequency Tabulation

Description

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

Usage

freqtab(x, v, xitems = 1:ncol(x), vitems = 1:ncol(v),
	xscale, vscale, na.rm = TRUE)
as.freqtab(x)

Arguments

x, v
either vectors of total scores, one per examinee, or matrices of item responses with which total scores will be calculated. x refers to the total test, and v refers to the anchor test. See below for details.
xitems, vitems
vectors of column numbers or names with which total scores will be computed for x and v when they contain item responses.
xscale, vscale
the score scales for forms X and V, as vectors.
na.rm
logical with default TRUE specifying whether or not missing item responses should be ignored, i.e., treated as 0, when calculating total scores.

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

With freqtab, if x and v are vectors of total scores, one per examinee, they will be factored with levels = xscale. This ensures that unobtained scores (i.e., scores not in x or v) will still be represented in the frequency tabulation.

When x is a matrix with at least two columns, total scores are calculated for each row across the columns specified in xitems. The same is true for v and vitems. If x and vitems are supplied but v is not, x is assumed to contain item responses for the anchor items as well. as.freqtab serves to simply change a frequency table x to class freqtab, as required by equate. The first column in ftab should contain the score scale. For a univariate distribution, the second column should contain the numbers of examinees obtaining each score in column 1. For a bivariate distribution, the second column in ftab should contain the anchor test score scale, and the third column the number of examinees obtaining each score combination.

See Also

table

Examples

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

as.freqtab(ACTmath[, 1:2])

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

Run the code above in your browser using DataLab