This function serves the role of formatting the data prior to the analysis.
dataFormat(data, na = NULL, id = 1, Z = NULL, w = NULL)
For binary response data. A matrix with rows representing the sample size and columns representing the number of items, where elements are either 0 or 1. \(u_{ij}=1\) indicates that student i correctly answered item j, while \(u_{ij}=0\) means that student i answered item j incorrectly. If the data contains NA values, any value can be filled in the matrix U, represented by the following missing value index matrix Z. However, in this function, -1 is assigned.
For polytomous response data. A matrix with rows representing the sample size and columns representing the number of items, where elements are non-negative integers. When input data is in factor format, the factor levels are converted to consecutive integers starting from 1, and the original factor labels are stored in factor_labels.
The ID label given by the designated column or function.
The item names given by the provided column names or function.
Missing indicator matrix. \(z_{ij}=1\) indicates that item j is presented to Student i, while \(z_{ij}=0\) indicates item j is NOT presented to Student i.
Item weight vector
Character string indicating the type of response data: "binary" for binary responses or "polytomous" for polytomous responses.
List containing the original factor labels when polytomous responses are provided as factors. NULL if no factor data is present.
Numeric vector containing the number of response categories for each item. For binary data, all elements are 2.
is a data matrix of the type matrix or data.frame.
na argument specifies the numbers or characters to be treated as missing values.
id indicates the column number containing the examinee ID. The default is 1. If the answer pattern is contained in the first column, it is treated as if there is no ID vector.
Z is a missing indicator matrix of the type matrix or data.frame
w is item weight vector