misfit_epmfd() computes selected person-fit statistics for polytomous
responses and returns an epmfd_misfit object with scores, thresholds,
and logical flags per person.
stats: actually computed statistics (subset of c("lpz","Gnp","U3p"))
thresholds: named list of lists with value and tail
scores: named list of numeric score vectors per statistic
table: a tibble with id, one logical column per statistic,
misfit_any (OR over selected stats), and misfit_final
(see Details)
Arguments
object
An epmfd_scaled object (output of your scaling step).
stats
Character vector choosing which statistics to compute.
Allowed values: "auto", "lpz", "Gnp", "U3p".
If "auto" is present, the set is chosen based on the detected
scaling method:
for "mirt": c("lpz","Gnp","U3p")
for "mokken": c("Gnp","U3p")
cut.off
Cut-off for Gnp and U3p. Either "auto" (default; uses
PerFit’s cutoff() with its implied tail), or a single numeric value
(interpreted with tail "upper" for both Gnp and U3p). lpz uses a
fixed lower-tail cut-off of -1.645.
Details
Auto vs manual decision for misfit_final:
If stats contains "auto":
for "mokken": misfit_final = Gnp & U3p
for "mirt": misfit_final = (lpz & Gnp & U3p) if any such rows exist,
otherwise fallback to lpz only.
If stats is manual (no "auto"): misfit_final is the AND over the
selected statistics (if only one selected, it is used directly).
Polytomous PerFit statistics assume a common design K (number of
categories) across items. This function uses object$raw$K as the global
design K and maps item responses to 0..K-1 without compressing per-item
gaps (unused categories are allowed and do not trigger an error).