View source: R/api-hierarchical-audit.R
| analyze_hierarchical_structure | R Documentation |
One-stop review that combines the nesting, cross-tabulation, ICC, and
design-effect reports into a single object. Designed to be reused by
the publication-workflow surface: its summary feeds into
reporting_checklist(), and its tables are picked up by
build_mfrm_manifest() for reproducibility bundles.
analyze_hierarchical_structure(
data,
facets = NULL,
person = "Person",
score = "Score",
compute_icc = TRUE,
ci_method = c("none", "profile", "boot"),
ci_level = 0.95,
ci_boot_reps = 1000L,
ci_boot_seed = NULL,
igraph_layout = TRUE,
icc_ci_method = NULL,
icc_ci_level = NULL,
icc_ci_boot_reps = NULL,
icc_ci_boot_seed = NULL
)
data |
Data frame in long format, or an |
facets |
Character vector of facet column names. When |
person |
Person column name. Defaults to |
score |
Score column name. Defaults to |
compute_icc |
Logical; if |
ci_method |
ICC confidence-interval method passed through to
|
ci_level |
Confidence level when |
ci_boot_reps |
Number of bootstrap replicates when
|
ci_boot_seed |
Optional RNG seed for reproducible bootstrap
CIs. Deprecated alias: |
igraph_layout |
Logical; if |
icc_ci_method, icc_ci_level, icc_ci_boot_reps, icc_ci_boot_seed |
Deprecated spellings of the |
A list of class mfrm_hierarchical_structure with:
nesting: output of detect_facet_nesting().
crosstabs: list of pairwise observation-count data.frames (long
format, suitable for heatmap plotting).
icc: output of compute_facet_icc() when requested.
design_effect: output of compute_facet_design_effect() when
requested.
connectivity: named list with bipartite-graph component summary
when igraph is available.
summary: one-row summary used by downstream reporting helpers.
facets: character vector of facet names that were reviewed
(echoed for downstream reporting helpers that need to label rows
by review scope).
nesting: a
detect_facet_nesting() object with every facet pair classified
as Crossed / Partially / Near-perfectly / Fully nested.
crosstabs: list of (LevelA, LevelB, N) long-format tables,
one per facet pair. Plot via plot(x, type = "crosstab", pair = "FacetA__FacetB").
icc: per-facet variance shares. See
compute_facet_icc() for the two-scale interpretation.
design_effect: Kish (1965) Deff and EffectiveN.
connectivity: number of bipartite components linking
Person x facet levels. A single component is required for a
common measurement scale; multiple components indicate a
disconnected design.
Optional: fit the MFRM with fit_mfrm().
Call analyze_hierarchical_structure(fit) (or on the raw data).
Read summary(x) for the condensed view.
Feed the object to reporting_checklist() and
build_mfrm_manifest() to record the review in publication
bundles. build_apa_outputs() uses the fit-level
FacetSampleSizeFlag to add a Methods sentence automatically.
McEwen, M. R. (2018). The effects of incomplete rating designs on results from many-facets-Rasch model analyses (Doctoral thesis, Brigham Young University). https://scholarsarchive.byu.edu/etd/6689/
Linacre, J. M. (2026). A User's Guide to FACETS, Version 4.5.0. Winsteps.com. https://www.winsteps.com/facets.htm
Kish, L. (1965). Survey Sampling. New York: Wiley.
Koo, T. K., & Li, M. Y. (2016). A guideline of selecting and reporting intraclass correlation coefficients for reliability research. Journal of Chiropractic Medicine, 15(2), 155-163.
detect_facet_nesting(), facet_small_sample_review(),
compute_facet_icc(), compute_facet_design_effect(),
reporting_checklist(), build_mfrm_manifest(), fit_mfrm().
toy <- load_mfrmr_data("example_core")
hs <- analyze_hierarchical_structure(toy,
facets = c("Rater", "Criterion"),
compute_icc = FALSE,
igraph_layout = FALSE)
summary(hs)
# Full review when lme4 and igraph are available.
if (requireNamespace("lme4", quietly = TRUE) &&
requireNamespace("igraph", quietly = TRUE)) {
hs_full <- analyze_hierarchical_structure(toy,
facets = c("Rater", "Criterion"))
summary(hs_full)
plot(hs_full, type = "icc")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.