| irtc_results | R Documentation |
Extracts fitted-model results as tidy data frames with a stable,
documented schema aimed at automated callers (pipelines, AI agents).
Column names are fixed English snake_case identifiers and never depend on
the language option. irtc_json exports the same content as JSON
(requires the optional jsonlite package).
Schema v1.1 components: model_info (one row: schema and package
version, model, sizes, deviance, AIC/BIC, EAP reliability, iterations,
and dimension_names when a Q matrix was supplied),
items (per item: parameters, classical statistics, fit, quality
rating and bilingual reasons/advice, plus a status column and,
for polytomous items, semantic step difficulties and rare-category
annotations), persons (per person: ID, number answered, raw
score, EAP, SE, percentile, T score; ability/SE headers use the Q
dimension names when available), cleaning_log and
check_issues (present when the model was fitted via
irtc). Schema 1.1 is additive over 1.0: existing column
names and meanings are unchanged. Items declared in the Q matrix but not
estimated keep a row with status "dropped_no_response" or
"declared_not_estimated". See the package file
inst/llms.txt for the full schema reference.
irtc_results(mod, resp = NULL)
irtc_json(mod, file = NULL, resp = NULL, pretty = TRUE)
## S3 method for class 'irtc_results'
print(x, lang = irtc_lang(), ...)
mod |
A fitted |
resp |
The response data; only needed when the model object does not store it (streaming engine). |
file |
Optional path; when given, the JSON is written there (UTF-8) and the path is returned invisibly. |
pretty |
Logical: pretty-print the JSON? |
x |
An |
lang |
Output language, |
... |
Ignored. |
irtc_results returns an object of class irtc_results, a list
of data frames as described above. irtc_json returns a JSON string,
or invisibly the file path when file is given.
irtc, irtc_excel
set.seed(1)
theta <- rnorm(150)
resp <- as.data.frame(sapply(seq(-1, 1, length.out = 5), function(b) {
as.numeric(runif(150) < plogis(theta - b))
}))
mod <- irtc(resp, model = "1PL", verbose = FALSE)
res <- irtc_results(mod)
res$model_info
head(res$items)
if (requireNamespace("jsonlite", quietly = TRUE)) {
json <- irtc_json(mod)
substr(json, 1, 80)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.