distractor_analysis: Distractor Analysis Function

View source: R/item_analysis.R

distractor_analysisR Documentation

Distractor Analysis Function

Description

Distractor Analysis Function

Usage

distractor_analysis(resp, key = NULL, ip = NULL, criterion = NULL)

Arguments

resp

It can be either a Response_set-class object with valid raw responses; or, a matrix or data.frame containing the raw item responses.

key

The answer key for the responses. Keys can also be provided via ip argument.

ip

An Itempool-class object that contains the keys of the items. The program will look check whether a ip$misc$key is specified for all items. Valid keys should be provided via ip if key argument is NULL.

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.

Value

A data.frame with following columns

'item_id'

Item identifier

'key'

Answer key

'option'

The selected option

'n'

Number of subjects/examinees answered this item

'prop'

Observed proportions of the choice.

'bis'

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

'pbis'

Point-biserial correlation between the examinees selected the choice and the total scores.

'bis_adj'

Biserial correlation between item and total score without this item. Sum scores will be used in the calculation of 'bis_adj' even 'criterion' is provided.

'pbis_adj'

Point-biserial correlation between item and total score without this item. Sum scores will be used in the calculation of 'bis_adj' even 'criterion' is provided.

Author(s)

Emre Gonulates

Examples

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(resp = raw_resp, key = key)



irt documentation built on Nov. 10, 2022, 5:50 p.m.