Skip to contents

Build a data quality summary report (preferred alias)

Usage

data_quality_report(
  fit,
  data = NULL,
  person = NULL,
  facets = NULL,
  score = NULL,
  weight = NULL,
  include_fixed = FALSE
)

Arguments

fit

Output from fit_mfrm().

data

Optional raw data frame used for row-level audit.

person

Optional person column name in data.

facets

Optional facet column names in data.

score

Optional score column name in data.

weight

Optional weight column name in data.

include_fixed

If TRUE, include a legacy-compatible fixed-width text block.

Value

A named list with data-quality report components. Class: mfrm_data_quality.

Details

summary(out) is supported through summary(). plot(out) is dispatched through plot() for class mfrm_data_quality (type = "row_audit", "category_counts", "missing_rows").

Interpreting output

  • summary: retained/dropped row overview.

  • row_audit: reason-level breakdown for data issues.

  • category_counts: post-filter category usage.

  • unknown_elements: facet levels in raw data but not in fitted design.

Typical workflow

  1. Run data_quality_report(...) with raw data.

  2. Check row-audit and missing/unknown element sections.

  3. Resolve issues before final estimation/reporting.

Examples

toy <- load_mfrmr_data("example_core")
fit <- fit_mfrm(toy, "Person", c("Rater", "Criterion"), "Score", method = "JML", maxit = 25)
out <- data_quality_report(
  fit, data = toy, person = "Person",
  facets = c("Rater", "Criterion"), score = "Score"
)
summary(out)
#> mfrmr Data Quality Summary 
#>   Class: mfrm_data_quality
#>   Components (5): summary, model_match, row_audit, unknown_elements, category_counts
#> 
#> Data quality overview
#>  TotalLinesInData TotalDataLines TotalNonBlankResponsesFound MissingScoreRows
#>               768            768                         768                0
#>  MissingFacetRows MissingPersonRows InvalidWeightRows OutOfRangeScoreRows
#>                 0                 0                 0                   0
#>  ValidResponsesUsedForEstimation
#>                              768
#> 
#> Audit rows: row_audit
#>  Status   N
#>   valid 768
#> 
#> Notes
#>  - Legacy-compatible Table 2 data quality summary and row-level audit.
p_dq <- plot(out, draw = FALSE)
class(p_dq)
#> [1] "mfrm_plot_data" "list"