| irtc_excel | R Documentation |
One call writes three separate .xlsx files (requires the optional
openxlsx package):
<prefix>_item_quality.xlsx - a plain-language item quality
table (score rate, difficulty label, discrimination, fit, colour-coded
overall rating, reasons and advice) plus a notes sheet explaining every
column, for judging item quality without statistical training.
<prefix>_item_parameters.xlsx - the IRT difficulty /
discrimination table with a frozen column schema
(schema_version, analysis_id, model,
item_id, n_obs, p_value, slope_a,
difficulty_b, se_b, tau_k), designed for
cross-year anchor-item linking: files from different administrations
can be merged directly on item_id.
<prefix>_person_ability.xlsx - a flat person ability table
(ID, number answered, raw score, EAP, standard error, percentile,
T score) whose rows stay in input order so it can be pasted next to a
master sample sheet.
irtc_excel(mod, dir = ".", prefix = "IRTC", lang = irtc_lang(),
resp = NULL, overwrite = FALSE, verbose = TRUE)
irtc_param_table(mod, resp = NULL)
irtc_person_table(mod, lang = irtc_lang())
mod |
A fitted |
dir |
Output directory (created if necessary). |
prefix |
File name prefix. |
lang |
Language of headers and notes, |
resp |
The response data; only needed when the model object does not store it (streaming engine). |
overwrite |
Logical: overwrite existing files? Otherwise an error of
class |
verbose |
Logical: print a completion message? |
irtc_excel invisibly returns a named character vector with the
three file paths (quality, parameters, ability).
irtc_param_table and irtc_person_table return the underlying
data frames and work without openxlsx.
irtc, irtc_report,
irtc_results
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)
## data frames behind the workbooks (no extra packages needed)
irtc_param_table(mod)
head(irtc_person_table(mod, lang = "en"))
if (requireNamespace("openxlsx", quietly = TRUE)) {
out <- irtc_excel(mod, dir = tempdir(), overwrite = TRUE,
verbose = FALSE)
basename(out)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.