This function takes a matrix or data.frame and the number of rating categories maxcat
and produces a three-way array of m by maxcat indicator matrices, one for each of the n rows.
The input x must be a matrix or data.frame of dimensions n by m
which contains the ratings on a scale of 1 to maxcat for m items. Note that missing values
(NA's) will not appear in the columns.
Usage
indarr(x, maxcat, na.add = TRUE)
Arguments
x
a matrix of data.frame
maxcat
an integer indicating the maximum of the rating scale (which is assumed to start with 1)
na.add
logical indicating whether to add a designated category for missings or not. Defaults to TRUE.