Learn R Programming

exametrika (version 1.14.0)

DistractorAnalysis: Distractor Analysis

Description

Performs distractor analysis for rated (multiple-choice) models. For each item and rank/class, computes observed category frequency tables, chi-square tests against chance level (uniform distribution), and Cramer's V as an effect size measure.

This function works with results from LRA (rated data) and Biclustering / Biclustering_IRM (rated data).

Usage

DistractorAnalysis(x, ...)

# S3 method for LRArated DistractorAnalysis(x, ...)

# S3 method for ratedBiclustering DistractorAnalysis(x, ...)

# S3 method for DistractorAnalysis print(x, items = NULL, ranks = NULL, digits = 4, ...)

# S3 method for DistractorAnalysis plot(x, type = "Distractor", items = NULL, ranks = NULL, nc = 1, nr = 1, ...)

Value

An object of class c("exametrika", "DistractorAnalysis") containing:

freq_table

List of frequency matrices (nrank x maxQ), one per item.

prop_table

List of proportion matrices (nrank x maxQ), one per item.

chisq_table

Matrix (nitems x nrank) of chi-square statistics.

pvalue_table

Matrix (nitems x nrank) of p-values.

cramersv_table

Matrix (nitems x nrank) of Cramer's V effect sizes.

CA

Correct answer vector.

n_rank

Number of ranks/classes.

maxQ

Number of response categories.

nitems

Number of items.

ItemLabel

Item label vector.

n_field

Number of fields (Biclustering only).

FieldEstimated

Field assignment vector (Biclustering only).

field_items

List of item indices per field (Biclustering only).

Arguments

x

A result object from a rated model (class LRArated or ratedBiclustering).

...

Additional arguments (currently unused).

items

Integer vector of item indices to display. NULL for all items.

ranks

Integer vector of rank/class indices to display. NULL for all ranks.

digits

Number of digits for rounding. Default is 4.

type

Plot type. Currently only "Distractor" is supported.

nc

Number of columns in the plot grid.

nr

Number of rows in the plot grid.

Examples

Run this code
# \donttest{
# LRA.rated example
result_lra <- LRA(J21S300, nrank = 5, mic = TRUE)
da <- DistractorAnalysis(result_lra)
print(da)
print(da, items = 1:3)
print(da, ranks = c(1, 5))
plot(da)
plot(da, items = 1:6, nc = 3, nr = 2)

# Biclustering.rated example
result_bic <- Biclustering(J21S300, ncls = 5, nfld = 3, method = "R")
da_bic <- DistractorAnalysis(result_bic)
print(da_bic, items = 1:7)
plot(da_bic, items = 1:6, nc = 3, nr = 2)
# }

Run the code above in your browser using DataLab