IRTC

English | 简体中文

CRAN status R CMD check License: GPL v2+

Item response theory (IRT) analysis in R that goes from a spreadsheet to a readable report — without requiring you to be a statistical programmer.

Most IRT packages start after your data is already a clean numeric matrix and stop at a model object you have to dig results out of. IRTC does those two ends for you as well, while leaving the full expert API available underneath.

Status: on CRAN — install with install.packages("IRTC"). The API is stable; 1.1.x is backward compatible with 1.0.

1.1.2 is a correctness release. Three of its fixes concern output that was silently wrong in 1.1.1 and earlier: the log-likelihood and information criteria reported by the multidimensional streaming engine, the item parameter table of a multidimensional model, and the option an answer key selected. If you have analyses made with an earlier version, see NEWS.md and run irtc_audit_scoring() on any that used key=.

What it looks like

One line from data to fitted model, and a summary in plain language rather than a wall of coefficients. This runs as-is on the bundled example data:

library(IRTC)
data(data.sim.rasch)
mod <- irtc(data.sim.rasch, model = "1PL")   # a file path works the same way
plain_summary(mod)
------------------------------------------------------------
Conclusion
------------------------------------------------------------
The test measured 2000 persons with 40 items. Score reliability is 0.87 (good).
40 of 40 items are of good or acceptable quality.

------------------------------------------------------------
Item quality
------------------------------------------------------------
Item quality: 40 good, 0 acceptable, 0 to review, 0 to revise.
Internal consistency (Cronbach's alpha): 0.8658.

------------------------------------------------------------
Ability distribution
------------------------------------------------------------
mean ability 0, spread (SD) 0.93, range -2.92 to 3.14.
Ability scores are on the logit scale; 0 is the population-model average,
higher means stronger.

------------------------------------------------------------
Next steps
------------------------------------------------------------
Export the three Excel tables: irtc_excel(mod).
Create a report: irtc_report(mod, "report.docx").
Full technical output: summary(mod).

The block above is abridged; an "Analysis overview" section is also printed.

irtc() reads Excel/CSV/TSV/SPSS/Stata/SAS or R objects, cleans the data with a traceable log, scores raw A/B/C/D responses against an answer key, checks the data, and estimates the model. Every expert argument passes straight through.

Install

install.packages("IRTC")

# development version:
# install.packages("remotes")
# remotes::install_github("weiandata/IRTC")
install.packages("IRTC", repos = c('https://weiandata.r-universe.dev', 'https://cloud.r-project.org'))

Requires R (>= 3.5.0) and a C++ toolchain (Rtools on Windows). Excel, SPSS and report output need optional packages (readxl, writexl, haven, officer); IRTC tells you which one to install if you use a feature that needs it.

Models and features

Three ways to use it

Survey and assessment staff — file in, results out:

mod <- irtc("responses.xlsx", model = "1PL")
plain_summary(mod)                            # plain-language summary
irtc_excel(mod, dir = "results")              # item quality / parameters / abilities
irtc_report(mod, "report.docx", audience = "decision")

Statisticians — the full expert API, nothing hidden:

data(data.sim.rasch)
mod <- irtc.mml(resp = data.sim.rasch)
summary(mod)
irtc_itemfit(mod)

AI agents and pipelines — machine-readable in and out:

chk <- irtc_check_data(irtc_read("responses.csv", verbose = FALSE))
if (chk$ok) {
    mod <- irtc("responses.csv", model = "2PL", verbose = FALSE)
    irtc_json(mod, "results.json")   # stable schema; see inst/llms.txt
}

Errors are structured conditions carrying a code, a reason and a fix.

Sampling weights, when supplied, are used throughout: the IRT estimation, the classical statistics, item fit, the quality ratings and the norm-referenced person columns all describe the same weighted population.

See examples/basic-usage.R for a runnable tour.

Documentation

Contributing

Issues and pull requests are welcome — see CONTRIBUTING.md for branch, commit, testing and review requirements. Report security concerns privately through SECURITY.md, not in public issues.

Bundled datasets are simulated by IRTC and reproducible via scripts/gen_data.R; they contain no real respondent data.

License

GPL (>= 2). See LICENSE and inst/COPYRIGHTS.

Copyright © 2026 WEIAN DATA TECH (Beijing) Co., Ltd. — contact@weiandata.com