Fast Many-Facet Measurement and Scoring with mfrmr

Overview

mfrmr provides high-speed C++ estimation, person scoring, diagnostics, RajuSA-Welch pairwise bias / DFF screening, color-vision-safe ggplot2 visualizations, generalizability analysis, and APA-style and rater-feedback reports. Start with mfrm_analysis() to run these analyses together, or use mfrm_workflow() and the step_mfrm_*() functions to review each stage.

The Generalized Many-Facet Rasch Model (GMFRM) estimates discrimination for one or two facets. The name follows Uto and Ueno (2020, Section 6), who generalized the many-facet Rasch model, which holds discrimination constant. In mfrmr, GMFRM covers an adjacent-category many-facet GPCM with facet-specific steps and a rating-scale form (many-facet RS-GPCM) with common steps. Use model = "GPCM" for either form, with step_facet = "Common" for shared steps on a common rubric. See ?fit_mfrm for supported specifications.

From ratings to a report

Each row of the bundled data is one rater’s score for one person on one rubric criterion. Check glance() for linkage and inference status before interpreting estimates. The Wright map places examinee ability, rater severity, and criterion difficulty on a common logit scale. The report also documents rater fit, observed and expected agreement, separation, observed-score G-Study and D-Study, and estimation notes. The report identifies results that cannot be interpreted with the fitted model or design.

library(mfrmr)
ratings <- load_mfrmr_data("example_core")
wf <- mfrm_analysis(ratings, "Person", c("Rater", "Criterion"), "Score")
glance(wf)[c("n_obs", "connected", "converged", "inference_status")]
#> # A tibble: 1 × 4
#>   n_obs connected converged inference_status
#>   <int> <lgl>     <lgl>     <chr>           
#> 1   768 TRUE      TRUE      ready
plot(wf, type = "wright")

plan <- data.frame(Rater = c("R01", "R02"),
                   Criterion = c("Content", "Organization"))
report_file <- render_mfrm_report(
  wf, file = tempfile(fileext = ".html"), format = "html", reference_plan = plan
)
feedback <- render_mfrm_report(wf, rater = "R01")

The Fair Average intervals above hold calibration and the common plan fixed. To reuse the tables without formatting them, use summary(wf, reference_plan = plan)$report_tables. To compare observed rater panels, supply a named rater-to-panel vector as rater_panels.

Use ?mfrm_analysis for input options and ?render_mfrm_report for Markdown, HTML, and Word output. For a guide to the corresponding FACETS output and when to use each model, see the assessment walkthrough.

1. Connectivity Audit and Fast C++ Estimation (RSM, PCM, and GMFRM)

Each row of example_core represents one person’s rating by a rater on an analytic rubric criterion (Score 1 to 4):

head(ratings, 4)
#>         Study Person Rater Criterion Score Group
#> 1 ExampleCore   P001   R01   Content     3     A
#> 2 ExampleCore   P002   R01   Content     3     A
#> 3 ExampleCore   P003   R01   Content     4     A
#> 4 ExampleCore   P004   R01   Content     3     A

conn <- check_mfrm_connectivity(
  ratings,
  person = "Person",
  facets = c("Rater", "Criterion"),
  score = "Score"
)
conn$connected
#> [1] TRUE
conn$n_subsets
#> [1] 1

An assessment team may ask whether the same category steps work for every criterion, and whether allowing different discrimination changes the fit. The RSM shares steps across criteria; the PCM gives each criterion its own steps; the GMFRM additionally estimates criterion discrimination. Fit all three by marginal maximum likelihood (MML) to the same ratings, with the same fixed standard-normal ability distribution and 31-point integration rule. These common settings make their nested likelihood comparisons interpretable. person_score = "WLE" chooses Warm’s score for reporting persons; it does not change the MML calibration likelihood.

fit_rsm <- fit_mfrm(
  ratings,
  person = "Person",
  facets = c("Rater", "Criterion"),
  score = "Score",
  model = "RSM",
  method = "MML",
  person_score = "WLE"
)
print(fit_rsm)
#> Many-Facet Measurement Fit [MML / RSM | Score: WLE]
#>   Ratings: 768 | Persons: 48 | Free par: 8 | Connected: YES (1 subset)
#>   Converged: TRUE (17 iter, max|grad| = 2.51e-14, 0.0680 s) | LogLik = -900.0126 | AIC = 1816.03
#>   Inference: ready  
#>   Population SD = 1.0000 | EAP Reliability = 0.8979
fit_rsm$facets[, c("Facet", "Level", "Estimate", "ModelSE", "RealSE", "FairM", "InfitMnSq")]
#>       Facet        Level    Estimate    ModelSE     RealSE    FairM InfitMnSq
#> 1     Rater          R01 -0.18381535 0.08209146 0.08209146 2.638184 0.9979413
#> 2     Rater          R02 -0.30884784 0.08298771 0.08298771 2.723503 0.8746011
#> 3     Rater          R03  0.17950280 0.08202273 0.08202273 2.386007 0.9171260
#> 4     Rater          R04  0.31316039 0.08294736 0.08294736 2.293516 0.9857476
#> 5 Criterion     Accuracy  0.23363891 0.08237044 0.08237044 2.348443 0.9671730
#> 6 Criterion      Content -0.38997316 0.08384145 0.08384145 2.778056 0.9570214
#> 7 Criterion     Language  0.09146369 0.08172648 0.08295481 2.447263 1.0302852
#> 8 Criterion Organization  0.06487056 0.08167028 0.08167028 2.465782 0.8216215

fit_pcm <- fit_mfrm(
  ratings,
  person = "Person",
  facets = c("Rater", "Criterion"),
  score = "Score",
  model = "PCM",
  step_facet = "Criterion",
  method = "MML"
)

fit_gpcm <- fit_mfrm(
  ratings,
  person = "Person",
  facets = c("Rater", "Criterion"),
  score = "Score",
  model = "GPCM",
  step_facet = "Criterion",
  slope_facet = "Criterion",
  spec = list(gpcm_mml_identification = "fixed_standard_normal"),
  control = list(quad_points = 31L)
)
fit_gpcm$slopes[, c("Facet", "Level", "Estimate", "ModelSE")]
#>       Facet        Level  Estimate   ModelSE
#> 1 Criterion     Accuracy 0.9152991 0.1202736
#> 2 Criterion      Content 0.9227647 0.1274870
#> 3 Criterion     Language 1.0659041 0.1463813
#> 4 Criterion Organization 1.1107795 0.1448946
comparison <- anova(fit_rsm, fit_pcm, fit_gpcm)
comparison$lrt
#>   Simpler  Complex FreeParamsSimpler FreeParamsComplex df    ChiSq     pValue
#> 1 fit_rsm  fit_pcm                 8                14  6 13.52681 0.03539257
#> 2 fit_pcm fit_gpcm                14                17  3  1.24064 0.74327460

Read each likelihood-ratio test as evidence about the restrictions removed between two models. A small p-value supports relaxing those restrictions under the likelihood assumptions; it does not establish practical importance or validate the more complex model. Inspect parameter estimates, uncertainty and residual diagnostics before choosing a model. Ineligible comparisons return no LRT table and explain the reason in comparison$comparison_basis.

In this example, the RSM-to-PCM p-value is 0.0354, whereas the PCM-to-GMFRM p-value is 0.743. At an illustrative 5% threshold, the data support criterion-specific steps, with little evidence here for the additional discrimination parameters. This is a model-comparison result for these ratings, not a recommendation to use PCM for every rubric.

Check summary(fit_rsm)$readiness before interpreting intervals. Optimizer convergence means that its stopping rule was met. Readiness additionally checks the implemented connectivity, information-matrix and boundary conditions; it does not establish model fit or nominal finite-sample coverage. Sparse ratings, rare categories and dependence among ratings can still affect uncertainty.

Use standard S3 methods for a supported prediction scenario and calibration intervals:

predict(
  fit_rsm,
  newdata = data.frame(theta = c(-1, 0, 1), Rater = "R01", Criterion = "Content"),
  type = "response"
)
#> [1] 2.216411 2.898806 3.440895
confint(fit_rsm, component = "facets")
#>                               2.5%       97.5%
#> Rater:R01              -0.34471166 -0.02291904
#> Rater:R02              -0.47150075 -0.14619492
#> Rater:R03               0.01874120  0.34026440
#> Rater:R04               0.15058654  0.47573423
#> Criterion:Accuracy      0.07219580  0.39508201
#> Criterion:Content      -0.55429938 -0.22564693
#> Criterion:Language     -0.06871728  0.25164465
#> Criterion:Organization -0.09520024  0.22494137

plot(fit_rsm, type = "wright", palette = "okabe_ito")

plot(fit_gpcm, type = "slopes", palette = "monochrome")

Positive rater estimates indicate greater severity, and positive criterion estimates indicate greater difficulty on the model’s logit scale. The facet intervals describe calibration uncertainty. Predictions above condition on the specified ability and calibrated facet levels; they are not prediction intervals for a new person’s observed score. See ?fit_mfrm and ?confint.mfrm_fit for identification, supported interval types and their limitations.

2. High-Speed Batch Replications

mfrm_batch_fit() executes Monte Carlo or bootstrap replications inside C++ worker threads without R interpreter overhead:

set.seed(42)
rep_scores <- replicate(5L, sample(1:4, nrow(ratings), replace = TRUE))
batch_summary <- mfrm_batch_fit(
  ratings,
  person = "Person",
  facets = c("Rater", "Criterion"),
  score = "Score",
  score_matrix = rep_scores,
  method = "CML",
  model = "RSM",
  rating_min = 1,
  rating_max = 4,
  threads = 1L,
  return_fits = FALSE
)
batch_summary
#>   Replicate Converged Iterations    LogLik   MaxAbsGrad
#> 1         1      TRUE          5 -923.7045 1.048051e-13
#> 2         2      TRUE          5 -926.1138 1.264544e-13
#> 3         3      TRUE          5 -924.4776 4.959460e-14
#> 4         4      TRUE          5 -926.0465 7.460699e-14
#> 5         5      TRUE          5 -919.2218 4.263256e-14