View source: R/irtc_check_data.R
| irtc_check_data | R Documentation |
Checks a response data set before model estimation and returns both a human-readable report and a machine-readable issue table, so that survey staff and automated callers (e.g. AI agents) can verify data quality and act on concrete fixes.
Checked, among others: number of items and persons, non-numeric (raw) response columns, negative or non-integer values, items without responses or without variance, extreme missingness, sparse categories, persons without any responses and duplicated person IDs.
irtc_check_data(x, key = NULL, verbose = TRUE)
## S3 method for class 'irtc_check'
print(x, lang = irtc_lang(), ...)
x |
An |
key |
If an answer key will be used for scoring, pass it here so that raw text columns are reported as scorable instead of as errors. |
verbose |
Logical: print the result? |
lang |
Output language, |
... |
Ignored. |
An object of class irtc_check: a list with ok (logical:
no error-level issues), n_persons, n_items,
n_errors, n_warnings and issues, a data frame with
columns code, severity ("error", "warning",
"info"), scope, where, message_en,
message_zh, fix_en, fix_zh.
irtc_read, irtc
d <- data.frame(i1 = c(0, 1, 1, 0), i2 = c(1, 1, 1, 1),
i3 = c(0, NA, 1, -9))
chk <- irtc_check_data(d, verbose = FALSE)
chk$ok
chk$issues[, c("code", "severity", "where")]
print(chk, lang = "en")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.