DistractorAnalysis: Distractor analysis

View source: R/DistractorAnalysis.R

DistractorAnalysisR Documentation

Distractor analysis

Description

Performs distractor analysis for each item and optional number of groups.

Usage

DistractorAnalysis(
  Data,
  key,
  item = "all",
  p.table = FALSE,
  num.groups = 3,
  criterion = NULL,
  crit.discrete = FALSE,
  cut.points,
  data,
  matching,
  match.discrete
)

Arguments

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.

Author(s)

Adela Hladka
Institute of Computer Science of the Czech Academy of Sciences
hladka@cs.cas.cz

Patricia Martinkova
Institute of Computer Science of the Czech Academy of Sciences
martinkova@cs.cas.cz

Examples

Data <- dataMedicaltest[, 1:100]
Databin <- dataMedical[, 1:100]
key <- dataMedicalkey

# distractor analysis for all items
DistractorAnalysis(Data, key)

# distractor analysis for item 1
DistractorAnalysis(Data, key, item = 1)
## Not run: 
# distractor analysis with proportions
DistractorAnalysis(Data, key, p.table = TRUE)

# distractor analysis for 6 groups
DistractorAnalysis(Data, key, num.group = 6)

# distractor analysis using specified criterion
criterion <- round(rowSums(Databin), -1)
DistractorAnalysis(Data, key, criterion = criterion)

# distractor analysis using discrete criterion
DistractorAnalysis(Data, key, criterion = criterion, crit.discrete = TRUE)

# distractor analysis using groups specified by cut.points
DistractorAnalysis(Data, key, cut.points = seq(10, 96, 10))

## End(Not run)


ShinyItemAnalysis documentation built on May 31, 2023, 7:08 p.m.