Data: character: data matrix or data.frame with rows representing unscored item responses from a multiple-choice test and columns corresponding to the items.
key: character: answer key for the items. The key must be a vector of the same length as ncol(Data). In case it is not provided, criterion needs to be specified.
item: numeric or character: either character "all" to apply for all items (default), or a vector of item names (column names of Data), or item identifiers (integers specifying the column number).
p.table: logical: should the function return the proportions? If FALSE (default), the counts are returned.
num.groups: numeric: number of groups to which are the respondents split.
criterion: numeric: numeric vector. If not provided, total score is calculated and distractor analysis is performed based on it.
crit.discrete: logical: is criterion discrete? Default value is FALSE. See details.
cut.points: numeric: numeric vector specifying cut points of criterion. See details.
data: deprecated. Use argument Data instead.
matching: deprecated. Use argument criterion instead.
match.discrete: deprecated. Use argument crit.discrete
instead.
Details
This function is an adapted version of the distractor.analysis() function from CTT package. In case that no criterion is provided, the scores are calculated using the item Data and key. The respondents are by default split into the num.groups-quantiles and the number (or proportion) of respondents in each quantile is reported with respect to their answers. In case that criterion is discrete (crit.discrete = TRUE), criterion is split based on its unique levels. Other cut points can be specified via cut.points
argument.
Examples
Data <- dataMedicaltest[,1:100]Databin <- dataMedical[,1:100]key <- dataMedicalkey
# distractor analysis for all itemsDistractorAnalysis(Data, key)# distractor analysis for item 1DistractorAnalysis(Data, key, item =1)## Not run:# distractor analysis with proportionsDistractorAnalysis(Data, key, p.table =TRUE)# distractor analysis for 6 groupsDistractorAnalysis(Data, key, num.group =6)# distractor analysis using specified criterioncriterion <- round(rowSums(Databin),-1)DistractorAnalysis(Data, key, criterion = criterion)# distractor analysis using discrete criterionDistractorAnalysis(Data, key, criterion = criterion, crit.discrete =TRUE)# distractor analysis using groups specified by cut.pointsDistractorAnalysis(Data, key, cut.points = seq(10,96,10))## End(Not run)
Author(s)
Adela Hladka
Institute of Computer Science of the Czech Academy of Sciences