| prepare_data | R Documentation |
Prepare Data for IRT Analysis
prepare_data(data)
data |
A data frame or matrix of binary responses (0 and 1). |
A list containing the following two components:
matrix: A numeric matrix of the original data, converted to numeric format and potentially reordered by total score.
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.