| build_visual_summaries | R Documentation |
Build warning and narrative summaries for visual outputs
build_visual_summaries(
fit,
diagnostics,
threshold_profile = "standard",
thresholds = NULL,
summary_options = NULL,
whexact = FALSE,
branch = c("original", "facets")
)
fit |
Output from |
diagnostics |
Output from |
threshold_profile |
Threshold profile name ( |
thresholds |
Optional named overrides for profile thresholds. |
summary_options |
Summary options for |
whexact |
Use exact ZSTD transformation. |
branch |
Output branch:
|
This function returns visual-keyed text maps to support dashboard/report rendering without hard-coding narrative strings in UI code.
thresholds can override any profile field by name. Common overrides:
n_obs_min, n_person_min
misfit_ratio_warn, zstd2_ratio_warn, zstd3_ratio_warn
pca_first_eigen_warn, pca_first_prop_warn
summary_options supports:
detail: "standard" or "detailed"
max_facet_ranges: max facet-range snippets shown in visual summaries
top_misfit_n: number of top misfit entries included
An object of class mfrm_visual_summaries with:
warning_map: visual-level warning text vectors
summary_map: visual-level descriptive text vectors
warning_counts, summary_counts: message counts by visual key
crosswalk: FACETS-reference mapping for main visual keys
branch, style, threshold_profile: branch metadata
warning_map: rule-triggered warning text by visual key.
summary_map: descriptive narrative text by visual key.
warning_counts / summary_counts: message-count tables for QA checks.
inspect defaults with mfrm_threshold_profiles()
choose threshold_profile (strict / standard / lenient)
optionally override selected fields via thresholds
pass result maps to report/dashboard rendering logic
mfrm_threshold_profiles(), build_apa_outputs()
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 = "both")
vis <- build_visual_summaries(fit, diag, threshold_profile = "strict")
vis2 <- build_visual_summaries(
fit,
diag,
threshold_profile = "standard",
thresholds = c(misfit_ratio_warn = 0.20, pca_first_eigen_warn = 2.0),
summary_options = list(detail = "detailed", top_misfit_n = 5)
)
vis_facets <- build_visual_summaries(fit, diag, branch = "facets")
vis_facets$branch
summary(vis)
p <- plot(vis, type = "comparison", draw = FALSE)
p2 <- plot(vis, type = "warning_counts", draw = FALSE)
if (interactive()) {
plot(
vis,
type = "comparison",
draw = TRUE,
main = "Warning vs Summary Counts (Customized)",
palette = c(warning = "#cb181d", summary = "#3182bd"),
label_angle = 45
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.