Build a package-native reference audit for report completeness
Source:R/api-reports.R
reference_case_audit.RdBuild a package-native reference audit for report completeness
Usage
reference_case_audit(
fit,
diagnostics = NULL,
bias_results = NULL,
reference_profile = c("core", "compatibility"),
include_metrics = TRUE,
top_n_attention = 15L
)Arguments
- fit
Output from
fit_mfrm().- diagnostics
Optional output from
diagnose_mfrm(). If omitted, diagnostics are computed internally withresidual_pca = "none".- bias_results
Optional output from
estimate_bias(). If omitted and at least two facets exist, a 2-way interaction screen is computed internally.- reference_profile
Audit profile.
"core"emphasizes package-native report contracts."compatibility"exposes the manual-aligned compatibility layer used byfacets_parity_report(branch = "facets").- include_metrics
If
TRUE, run numerical consistency checks in addition to schema coverage checks.- top_n_attention
Number of lowest-coverage components to keep in
attention_items.
Details
This function repackages the internal contract audit into package-native terminology so users can review output completeness without needing external manual/table numbering. It reports:
component-level schema coverage
numerical consistency checks for derived report tables
the highest-priority attention items for follow-up
It is an internal completeness audit for package-native outputs, not an external validation study.
Use reference_profile = "core" for ordinary mfrmr workflows.
Use reference_profile = "compatibility" only when you explicitly want to
inspect the compatibility layer.
Interpreting output
overall: one-row internal audit summary with schema coverage and metric pass rate.component_summary: per-component coverage summary.attention_items: quickest list of components needing review.metric_summary/metric_checks: numerical consistency status.
Examples
toy <- load_mfrmr_data("example_core")
fit <- fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score", method = "JML", maxit = 25)
diag <- diagnose_mfrm(fit, residual_pca = "none")
audit <- reference_case_audit(fit, diagnostics = diag)
summary(audit)
#> mfrmr Internal Reference Audit Summary
#> Class: mfrm_reference_audit
#> Components (7): overall, component_summary, attention_items, metric_summary, metric_checks, settings, parity
#>
#> Attention items: metric_summary
#> Checks Evaluated Passed Failed PassRate
#> 14 14 14 0 1
#>
#> Settings
#> Setting Value
#> reference_profile core
#> contract_branch original
#> intended_use internal_contract_audit
#> external_validation FALSE
#> include_metrics TRUE
#> top_n_attention 15
#>
#> Notes
#> - No `summary` component found; showing preview rows from the main table.