fit_binary_irt: Fit Binary IRT Model using GLM

View source: R/functions.R

fit_binary_irtR Documentation

Fit Binary IRT Model using GLM

Description

Fit Binary IRT Model using GLM

Usage

fit_binary_irt(data_mat, total_score)

Arguments

data_mat

A numeric matrix of responses (persons in rows, items in columns).

total_score

A numeric vector of total scores for each person.

Value

A data frame with one row per item and the following columns:

  • Item: The name of the item.

  • Intercept: The estimated intercept parameter from the GLM logit model.

  • Slope: The estimated slope parameter (discrimination) from the GLM logit model.

  • threshold: The calculated item difficulty (also known as the beta parameter), computed as -Intercept / Slope. This represents the point on the ability scale where the probability of a correct response is 0.5.

Examples

set.seed(42)
sample_data <- matrix(sample(c(0, 1), 50, replace = TRUE), ncol = 5)
colnames(sample_data) <- paste0("Item", 1:5)

prepared <- prepare_data(sample_data)

irt_results <- fit_binary_irt(prepared$matrix, prepared$total_score)

print(irt_results)


GLMBasedRaschEstimation documentation built on April 22, 2026, 9:08 a.m.