% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{fit_binary_irt}
\alias{fit_binary_irt}
\title{Fit Binary IRT Model using GLM}
\usage{
fit_binary_irt(data_mat, total_score)
}
\arguments{
\item{data_mat}{A numeric matrix of responses (persons in rows, items in columns).}

\item{total_score}{A numeric vector of total scores for each person.}
}
\value{
A data frame with one row per item and the following columns:
\itemize{
\item \code{Item}: The name of the item.
\item \code{Intercept}: The estimated intercept parameter from the GLM logit model.
\item \code{Slope}: The estimated slope parameter (discrimination) from the GLM logit model.
\item \code{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.
}
}
\description{
Fit Binary IRT Model using GLM
}
\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)

}
