Learn R Programming

irt (version 0.1.1)

distractor_analysis: Distractor Analysis Function

Description

Distractor Analysis Function

Usage

distractor_analysis(
  raw_resp,
  key,
  criterion = NULL,
  adjusted = FALSE,
  suppress_output = FALSE
)

Arguments

raw_resp

A matrix or data.frame containing the item responses.

key

The answer key for the responses

criterion

Provide a continuous criterion variable such as a total raw score, or theta score that will be used in the calculation of correlation calculations. If this value is NULL, the total score will be used.

adjusted

If TRUE, the biserial will be calculated using the total score that is calculated using all of the items except the item that biserial is calculated for.

suppress_output

If TRUE, the function will suppress console output. Default value is FALSE

Value

A list of

'prop'

Observed proportions of each choice.

'biserial'

Biserial correlation between the examinees selected the choice and the total scores.

'score'

Scored response matrix.

Examples

Run this code
# NOT RUN {
n_item <- 10 # sample(8:12, 1)
n_theta <- 50 # sample(100:200, 1)
raw_resp <- matrix(sample(LETTERS[1:4], n_item * n_theta, replace = TRUE),
                   nrow = n_theta, ncol = n_item,
                   dimnames = list(paste0("Examinee-", 1:n_theta),
                                   paste0("Item-", 1:n_item)))
# Add some missing responses
raw_resp[sample(1:length(raw_resp), round(length(raw_resp)*.1))] <- NA
# Prepare answer key
key <- sample(LETTERS[1:4], n_item, replace = TRUE)

# Run distractor analysis:
da <- distractor_analysis(raw_resp = raw_resp, key = key)

# }

Run the code above in your browser using DataLab