% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions.R
\name{prepare_data}
\alias{prepare_data}
\title{Prepare Data for IRT Analysis}
\usage{
prepare_data(data)
}
\arguments{
\item{data}{A data frame or matrix of binary responses (0 and 1).}
}
\value{
A list containing the following two components:
\itemize{
\item \code{matrix}: A numeric matrix of the original data, converted to numeric format and potentially reordered by total score.
\item \code{total_score}: A numeric vector representing the sum of correct responses (row sums) for each person, sorted in descending order if the original data was unsorted.
}
}
\description{
Prepare Data for IRT Analysis
}
\examples{
set.seed(123)
raw_data <- data.frame(
  item1 = c(1, 0, 1, 1),
  item2 = c(0, 0, 1, 1),
  item3 = c(1, 1, 1, 0)
)

prepared <- prepare_data(raw_data)

print(prepared$matrix)
print(prepared$total_score)

}
