| Type: | Package |
| Title: | Fast Estimation, Diagnostics, and Generalizability for Many-Facet Models |
| Version: | 0.3.2 |
| Date: | 2026-11-26 |
| Description: | Estimates many-facet ordered-response measurement models (Rating Scale, Partial Credit, and Generalized Many-Facet Rasch Models) including step constraints, declarative category support, explanatory facet covariates, and joint interactions via high-speed C++ Joint Maximum Likelihood, Jeffreys-penalized Joint Maximum Likelihood with Block-Schur standard errors, Gauss-Hermite and Laplace-adaptive Marginal Maximum Likelihood (with expected a posteriori scoring, Warm's weighted likelihood estimation, latent regression, and sandwich covariances), Conditional Maximum Likelihood, and Laplace empirical Bayes Markov rater drift models. Provides multi-threaded C++ batch estimation, connectivity audits prior to estimation, fit diagnostics, Fair(M), Real SE, 'RajuSA-Welch' pairwise bias and parallel split-element differential facet functioning, color-vision-safe 'ggplot2' graphics, and Generalizability (G-Study) and Decision (D-Study) planning including fast Henderson Method 1 ('urGENOVA') estimation. Connects calibration, diagnostics, visualizations, and Markdown, HTML, or Word report generation in one analysis workflow. See Andrich (1978) <doi:10.1007/BF02293814>, Masters (1982) <doi:10.1007/BF02296272>, Warm (1989) <doi:10.1007/BF02294627>, Raju (1990) <doi:10.1177/014662169001400208>, Uto and Ueno (2020) <doi:10.1007/s41237-020-00115-7>, and Brennan (2001, ISBN:9780387952826). |
| URL: | https://github.com/Ryuya-dot-com/mfrmr |
| BugReports: | https://github.com/Ryuya-dot-com/mfrmr/issues |
| License: | MIT + file LICENSE |
| Language: | en |
| Encoding: | UTF-8 |
| LazyData: | true |
| Depends: | R (≥ 4.1) |
| Imports: | dplyr, generics, ggplot2 (≥ 3.5.0), grDevices, graphics, grid, lpSolve, Matrix, methods, rlang, stats, tibble, tidyr, tools, utils |
| LinkingTo: | cpp11 (≥ 0.5.4) |
| Suggests: | callr, flextable, jsonlite, kableExtra, knitr, lme4, minqa, nloptr, officer, pkgload, rmarkdown, RSpectra, testthat (≥ 3.0.0), withr |
| VignetteBuilder: | knitr |
| Config/testthat/edition: | 3 |
| Config/roxygen2/version: | 8.1.1 |
| NeedsCompilation: | yes |
| Packaged: | 2026-11-26 03:44:13 UTC; tohokusla |
| Author: | Ryuya Komuro |
| Maintainer: | Ryuya Komuro <ryuya.komuro.c4@tohoku.ac.jp> |
| Repository: | CRAN |
| Date/Publication: | 2026-11-26 08:30:08 UTC |
Fast Estimation, Diagnostics, and Generalizability for Many-Facet Models
Description
Estimates Many-Facet Rasch Measurement models (RSM, PCM, and GPCM) including step constraints, declarative category support, explanatory facet covariates, and joint interactions via high-speed C++ Joint Maximum Likelihood, Jeffreys-penalized JML with Block-Schur standard errors, Gauss-Hermite and Laplace-adaptive Marginal Maximum Likelihood (with EAP, Warm's WLE, latent regression, and sandwich covariances), Conditional Maximum Likelihood, and Markov rater drift models. Also provides multi-threaded batch estimation, graph connectivity checks, Fair(M), Real SE, RajuSA-Welch pairwise bias and parallel split-element DFF, color-vision-safe ggplot2 graphics, and Generalizability (G-Study) and Decision (D-Study) planning.
Examples
ratings <- load_mfrmr_data("example_core")
fit <- fit_mfrm(ratings, "Person", c("Rater", "Criterion"), "Score")
summary(fit)$overview
Differential Facet Functioning (Parallel Split-Element LRT, RajuSA-Welch, MH, and Logistic)
Description
Screens Differential Facet Functioning (DFF) of raters, tasks, or criteria across reference and focal groups via warm-started parallel C++ split-element MML LRT (with person-clustered sandwich SEs and latent-regression group impact control), CML LRT, FACETS 4.5.3 RajuSA-Welch contrasts, stratified Mantel-Haenszel, or cumulative-logit LRT.
Usage
analyze_dff(
fit, facet, group, data = NULL, focal = NULL,
method = c("mml_lrt", "cml_lrt", "raju_welch", "mh", "logistic"),
df_method = c("facets", "classical"), min_obs = 10, p_adjust = "holm",
threads = 1L)
Arguments
fit |
A fitted model object returned by |
facet |
Character string naming the model facet to screen for differential functioning (e.g., |
group |
Character string naming the grouping variable in |
data |
Optional |
focal |
Optional character string specifying the focal group level in |
method |
DFF test family: |
df_method |
Degrees-of-freedom convention when |
min_obs |
Minimum required ratings per group for an element to be tested (default |
p_adjust |
Multiple-testing adjustment method passed to |
threads |
Integer number of C++ worker threads for parallel split-element refits (default |
Details
When _R_CHECK_LIMIT_CORES_ requests a core limit, native worker counts are capped at two. The default remains one worker.
Split-likelihood tests support unified, unpenalized RSM/PCM calibrations without
anchors, custom facet/step constraints, interactions or restricted category
support. Unsupported specifications are rejected rather than dropped.
Weights, facet signs and integration/optimizer controls are retained.
The selected test method determines the refitting estimator. With
method = "mml_lrt", both models are refitted by MML even if the
supplied calibration was estimated by JML.
MML refits retain source population covariates and add person-level group
impact when linearly independent; a fixed-normal source is explicitly extended
to an estimated population. Both the baseline and split models use this same
population design. A group varying within person cannot be a person-level
impact covariate. CML tests condition on person totals and do not use a
population distribution.
Both likelihood refits must pass numerical readiness and likelihood checks.
Otherwise SE, Statistic, pValue, pAdj and
Flagged are NA, with InferenceStatus/InferenceReason.
ElementsTested in summaries counts available tests;
ElementsUnavailable counts unavailable rows. An all-unavailable
Flagged count is NA. These checks do not establish finite-sample
test size or power.
RajuSA-Welch analysis holds the source calibration fixed, including GPCM
slopes, and appends a zero-valued group context without recalibration. Other
fixed-calibration screens also withhold inferential output if the source is
not ready. Supplied data must contain exactly the retained calibration
ratings and weights; reordered rows are aligned before adding group labels.
Value
An S3 object of class "mfrm_dff" containing table (Facet, Level, ReferenceGroup, FocalGroup, ObsRef, ObsFocal, Contrast, SE, Statistic, df, pValue, pAdj, Flagged), method, reference, and focal. Supports summary() and plot().
See Also
fit_mfrm, estimate_bias, plot.mfrm_fit
Examples
# Saved JML calibration of example_bias, with planted Group x Criterion DFF.
saved <- readRDS(system.file("examples", "bias-jml.rds", package = "mfrmr"))
ratings <- load_mfrmr_data(saved$dataset)
fit <- saved$fit
# Fixed-calibration screen: no split-model refitting.
dff <- analyze_dff(fit, facet = "Criterion", group = "Group", data = ratings,
method = "raju_welch")
summary(dff)
plot(dff)
Link and Calibrate New Ratings Against Baseline Facet Anchors
Description
Extracts element anchors from a baseline calibration (baseline_fit), calibrates a new rating cohort (new_data) on the baseline logit scale, and optionally compares benchmark elements to estimates linked through declared stable reference anchors.
Usage
anchor_to_baseline(
new_data, baseline_fit, person, facets, score, anchor_facets = NULL,
include_person = FALSE, weight = NULL, model = NULL, method = NULL,
anchor_policy = "warn", mml_integration = NULL, centering_scope = NULL,
..., drift_reference = NULL)
Arguments
new_data |
A |
baseline_fit |
A fitted baseline model object from |
person |
Character string naming the person identifier column in |
facets |
Character vector naming non-person facet columns in |
score |
Character string naming the numeric score column in |
anchor_facets |
Optional subset of |
include_person |
Logical; whether to anchor common persons as well (default |
weight |
Optional observation weight column name in |
model |
Optional model family override; defaults to |
method |
Optional estimation method override; defaults to |
anchor_policy |
Policy for anchors absent from |
mml_integration |
Optional MML quadrature mode override. |
centering_scope |
Optional centering scope ( |
drift_reference |
Optional data frame of stable baseline anchor IDs with columns |
... |
Additional arguments forwarded to |
Value
An S3 object of class "mfrm_anchored_fit" containing fit (new cohort calibrated on the baseline scale), diagnostics, baseline_anchors, and drift (element-by-element change on the linked scale).
For unified fits without an independent reference, Drift and Flag
are unavailable. In supported additive RSM/PCM fits, the comparison is conditional
on the supplied baseline reference and uses the new-fit standard error.
It is distinct from the local conditional displacement reported for a fixed
element or group in a single fitted calibration. Supports summary().
See Also
make_anchor_table, detect_anchor_drift, fit_mfrm
Examples
ratings <- load_mfrmr_data("example_core")
wave1 <- subset(ratings, Group == "A")
wave2 <- subset(ratings, Group == "B")
base_fit <- fit_mfrm(wave1, person = "Person", facets = c("Rater", "Criterion"), score = "Score")
linked <- anchor_to_baseline(
wave2,
baseline_fit = base_fit,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score",
anchor_facets = "Criterion"
)
linked$drift
Apply Empirical Bayes Shrinkage to Facet and Person Estimates
Description
Applies post-estimation precision-weighted Empirical Bayes shrinkage toward each facet's mean location using estimated between-element variance \hat{\tau}^2 = \max(0, s_{\hat{\beta}}^2 - \overline{\mathrm{SE}^2}) (or a user-supplied facet_prior_sd), stabilizing noisy estimates for low-exposure raters or tasks.
Usage
apply_empirical_bayes_shrinkage(
fit, facet_prior_sd = NULL, shrink_person = FALSE)
Arguments
fit |
A fitted model object returned by |
facet_prior_sd |
Optional positive numeric prior standard deviation (in logits) overriding empirical |
shrink_person |
Logical; if |
Value
An updated fit object retaining original Estimate and adding ShrunkEstimate and ShrunkSE columns in fit$facets (and fit$person when shrink_person = TRUE).
See Also
Examples
ratings <- load_mfrmr_data("example_operational")
fit <- fit_mfrm(
ratings, person = "Person", facets = c("Rater", "Criterion"), score = "Score"
)
shrunk <- apply_empirical_bayes_shrinkage(fit)
cols <- c("Facet", "Level", "ObsCount", "Estimate", "ShrunkEstimate", "ShrunkSE")
shrunk$facets[, cols]
Augment Observation Rows with Expected Scores and Standardized Residuals
Description
Appends observation-level expected rubric scores, raw and standardized Pearson
residuals, observed category probabilities, and unexpected-response flags
(|StdResidual| >= 2.0) to the analyzed rating rows.
Usage
augment(x, ...)
## S3 method for class 'tidymfrm'
augment(x, ...)
Arguments
x |
A |
... |
Additional arguments (unused). |
Value
A tibble::tibble() of observation-level expectations and residuals.
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
ratings <- load_mfrmr_data(saved$dataset)
wf <- mfrm_workflow(ratings, "Person", c("Rater", "Criterion"), "Score",
fit = saved$fit)
head(augment(wf))
Audit Multi-Facet Rating Graph Connectivity and Category Support in C++
Description
Performs a fast pre-estimation C++ union-find connectivity and category-support audit on a rating table before fitting a Many-Facet Rasch model. Identifies disconnected rating subsets (islands lacking shared persons, raters, tasks, anchors, or explanatory covariates) and checks whether interior rubric categories are observed.
Usage
check_mfrm_connectivity(
data, person, facets, score, model = c("RSM", "PCM", "GPCM"),
step_facet = NULL, rating_min = NULL, rating_max = NULL, anchors = NULL,
group_anchors = NULL, dummy_facets = NULL, category_support = NULL,
facet_formulas = NULL, facet_data = NULL, rater_facet = NULL,
network = FALSE, rater_panels = NULL)
Arguments
data |
A |
person |
Character string naming the person identifier column. |
facets |
Character vector naming non-person facet columns (e.g., |
score |
Character string naming the numeric rubric score column. |
model |
Measurement model family ( |
step_facet |
Facet owning category thresholds when |
rating_min |
Optional integer minimum rubric score. |
rating_max |
Optional integer maximum rubric score. |
anchors |
Optional individual element anchor |
group_anchors |
Optional group-mean anchor |
dummy_facets |
Optional character vector of facets fixed at 0 logits. |
category_support |
Optional |
facet_formulas |
Optional named list of explanatory facet covariate formulas. |
facet_data |
Optional named list of element covariate |
network |
Logical. Compute the Fiedler value of the unnormalized observed Person-by-rater Laplacian. Large graphs use the optional RSpectra package. |
rater_panels |
Optional named character vector assigning observed rater IDs to two or more panels. Compute resistance between equal-weight panel mean contrasts. |
rater_facet |
Facet for the observed Person-by-rater comparison graph. If |
Value
A list containing the multi-facet graph status and counts, per-person score
and subset summaries, facet subsets, and the interior category support flag.
When a rater facet is available, rater_linkage gives the observed
Person-by-rater component table and the persons whose individual removal
separates the remaining observed panels. This graph uses shared persons,
independently of anchors and shared levels of other facets. Each observed
Person-by-rater pair contributes one edge regardless of the number of criteria
or repeated scores. The Fiedler value is zero for a disconnected graph.
A panel contrast that requires current to cross disconnected components has
infinite effective resistance. These statistics describe assignment structure.
See Also
Examples
# Check incomplete two-rater operational assignment (48 persons, 6 raters, 3 criteria)
ratings <- load_mfrmr_data("example_operational")
conn <- check_mfrm_connectivity(
ratings,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score"
)
conn$connected
conn$n_subsets
conn$rater_linkage
Compute Cut-Score Classification Accuracy and Consistency Indices
Description
Computes conditional and population-weighted classification accuracy, consistency, overclassification, and underclassification probabilities under a specified multi-facet rating plan using both Lee's (2010) exact summed-score convolution method ("lee_sum") and Rudner's (2005) asymptotic normal ability-estimate approximation ("rudner_normal").
Usage
classification_table(
fit, rating_plan = NULL, cut_scores = 0, score_cuts = NULL,
theta = seq(-3, 3, by = 0.5), theta_weights = NULL,
operational_cuts = cut_scores, facets = NULL,
readiness_policy = c("error", "review"))
Arguments
fit |
A converged |
rating_plan |
A |
cut_scores |
Sorted numeric vector of true latent ability cutoffs in logits. |
score_cuts |
Nondecreasing integer vector of summed-score cutoffs (on |
theta |
Numeric vector of latent ability evaluation points. |
theta_weights |
Optional nonnegative numeric weights matching |
operational_cuts |
Sorted numeric vector of operational logit ability cutoffs used by Rudner's decision rule (defaults to |
facets |
Optional character vector mapping |
readiness_policy |
|
Value
A list containing table (conditional accuracy, consistency, over/underclassification, expected sum, information, and SEM at each theta), marginal (population-weighted summary when theta_weights is supplied), classification_matrix (joint true-by-observed category probabilities), cuts, probabilities, scores, and notes.
See Also
Examples
ratings <- load_mfrmr_data("example_core")
fit <- fit_mfrm(ratings, person = "Person", facets = c("Rater", "Criterion"), score = "Score")
# Evaluate a 2-rater x 4-criterion (8-rating, max category sum = 24) pass/fail plan at 0 logits
plan <- expand.grid(
Rater = c("R01", "R02"),
Criterion = c("Content", "Organization", "Language", "Accuracy"),
stringsAsFactors = FALSE
)
th_grid <- seq(-3, 3, by = 0.5)
cls <- classification_table(
fit,
rating_plan = plan,
cut_scores = 0,
score_cuts = 12,
theta = th_grid,
theta_weights = stats::dnorm(th_grid)
)
cls$marginal
Compare Many-Facet Models via Information Criteria and Affine-Subspace LRT
Description
Compares two or more fitted Many-Facet models by log-likelihood, AIC, BIC, and (when nested = TRUE or called via anova()) formal likelihood-ratio tests after algebraically verifying affine parameter-subspace nesting across facet locations, step constraints, and GPCM log-slopes.
Usage
compare_mfrm(
..., labels = NULL, warn_constraints = TRUE, nested = FALSE)
Arguments
... |
Two or more fitted model objects from |
labels |
Optional character vector of model labels. |
warn_constraints |
Logical; whether to warn when compared models differ in estimation method, sample size, or non-nested parameter subspaces. |
nested |
Logical; if |
Value
An S3 object of class "mfrm_comparison" containing table (Model, Family, Method, N, FreeParams, LogLik, AIC, BIC, DeltaAIC, DeltaBIC), lrt (sequential LRT table when nested = TRUE and models are verified nested), and comparison_basis.
See Also
Examples
ratings <- load_mfrmr_data("example_core")
fit_rsm <- fit_mfrm(ratings, "Person", c("Rater", "Criterion"), "Score", model = "RSM")
fit_pcm <- fit_mfrm(ratings, "Person", c("Rater", "Criterion"), "Score",
model = "PCM", step_facet = "Criterion")
cmp <- compare_mfrm(fit_rsm, fit_pcm, labels = c("RSM", "PCM"), nested = TRUE)
cmp$table
cmp$lrt
Compute Category Probability and Fisher Test Information Curves
Description
Evaluates Fisher test information I(\theta), conditional standard error \mathrm{SE}(\theta) = 1 / \sqrt{I(\theta)}, expected total score, and reference category probability curves across a grid of latent ability values for "RSM", "PCM", and "GPCM" calibrations.
Usage
compute_information(
fit, theta_range = c(-6, 6), theta_points = 201L, rating_plan = NULL,
exposure_basis = c("observed_total", "per_person_average"))
Arguments
fit |
A fitted model object returned by |
theta_range |
Numeric vector of length 2 giving the lower and upper logit bounds of the |
theta_points |
Integer number of evaluation points along |
rating_plan |
Optional |
exposure_basis |
With observed ratings, use |
Details
Information is additive for conditionally independent ratings with fixed
calibration. Conditional SE does not propagate calibration uncertainty.
Fitted calibrations report the exposure basis and counts and flag new
combinations of calibrated levels in
exposures$ObservedContext. An unsupported or numerically unready
calibration cannot be used for a precision curve.
Value
An S3 object of class "mfrm_information" containing test_information (Theta, Information, SE, ExpectedScore) and category_curves (ScaleLevel, Theta, Category, Probability). Supports plot.mfrm_fit.
See Also
fit_mfrm, classification_table, plot.mfrm_fit
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
fit <- saved$fit
info <- compute_information(fit, theta_range = c(-4, 4), theta_points = 81L)
head(info$test_information)
plot(info, type = "information")
Compute Parametric Person-Fit Statistics (lz and Outfit/Infit Screening)
Description
Computes the standardized log-likelihood person-fit index l_z (Drasgow, Levine, & Williams, 1985) alongside person-level InfitMnSq and OutfitMnSq from a fitted Many-Facet model or diagnostic bundle to screen aberrant examinee rating patterns.
Usage
compute_person_fit_indices(
diagnostics, fit = NULL)
Arguments
diagnostics |
Either a fitted model object from |
fit |
Optional matching |
Details
For each retained response, category probabilities give the log-probability mean and variance. If any response term for a person is unavailable, the person statistic is withheld rather than computed on a selected subset.
For converged, unpenalized JML person estimates with unit weights, the
conditional ability correction projects centered log likelihood off the
person likelihood score. With total log-likelihood variance V,
score information I, log-likelihood/score covariance C,
centered log likelihood L-E(L) and observed score derivative U,
the reported correction is
l_z^* = \frac{L-E(L)-(C/I)U}{\sqrt{V-C^2/I}}.
These moments sum over the person's observed rating design and condition on the fitted non-person calibration. They do not include calibration uncertainty. The correction is not supplied for EAP, WLE, penalized or adjusted person scores, non-unit weights, nonconvergence, or insufficient information. Their status remains explicit.
The two-sided normal-reference cutoffs 1.96 and 2.58 are
screening references, not calibrated individual or familywise error rates.
Short, sparse or dependent rating patterns need design-specific validation.
The plot uses the same reported index and flags; Outfit above 1.50 is
shown separately. Neither flag alone establishes aberrant behavior.
Value
A data frame of class mfrm_person_fit_indices for either engine.
TotalN, N and UnavailableN count retained, usable and
unavailable response terms. LogLik, lz, lz_star and
lz_star_status describe the statistics and correction eligibility.
ReportIndex, ReportValue and ReportFlag use the corrected
index when available, otherwise uncorrected l_z. ReportCaveat
records the interpretation limits. Infit and Outfit are separate descriptive
indices. Compatibility aliases ObsCount, L0 and Flagged
refer to N, LogLik and ReportFlag; x$table returns
the same table as a plain data frame. Use summary(x) for an overview.
References
Snijders, T. A. B. (2001). Asymptotic null distribution of person fit statistics with estimated person parameter. Psychometrika, 66, 331–342. doi:10.1007/BF02294437.
Sinharay, S. (2016). Asymptotically correct standardization of person-fit statistics beyond dichotomous items. Psychometrika, 81, 992–1013. doi:10.1007/s11336-015-9465-x.
See Also
Examples
ratings <- load_mfrmr_data("example_core")
fit <- fit_mfrm(ratings, person = "Person", facets = c("Rater", "Criterion"), score = "Score")
pfit <- compute_person_fit_indices(fit)
summary(pfit)
plot(fit, type = "person_fit")
Summarize Rating Design Structure, Sparsity, Overlap, and Missing Codes
Description
Audits raw rating tables prior to calibration: summarizes category frequencies, element exposure counts, rater-pair shared-unit overlap, connectivity, duplicate cells, declared missing-value codes, and optional structural omissions relative to a planned assignment roster (expected_design).
Usage
describe_mfrm_data(
data, person = NULL, facets = NULL, score = NULL, weight = NULL,
rating_min = NULL, rating_max = NULL, keep_original = FALSE,
missing_codes = NULL, include_person_facet = FALSE,
include_agreement = TRUE, rater_facet = NULL, context_facets = NULL,
agreement_top_n = NULL, expected_design = NULL, min_linking_persons = 2L,
category_policy = NULL, repeated_ratings = c("review", "independent"),
comparisons = NULL, spec = NULL)
Arguments
data |
A |
person |
Character string naming the person identifier column. |
facets |
Character vector naming non-person facet columns. |
score |
Character string naming the numeric rating column. |
weight |
Optional character string naming an observation weight column. |
rating_min |
Optional integer minimum rubric score. |
rating_max |
Optional integer maximum rubric score. |
keep_original |
Logical; whether to retain original uncleaned columns in internal audit tables. |
missing_codes |
Optional vector of values in |
include_person_facet |
Logical; whether to include individual person exposure rows in element tables. |
include_agreement |
Logical; whether to compute pairwise rater overlap and exact agreement summaries (default |
rater_facet |
Optional character string identifying the rater facet for overlap summaries. |
context_facets |
Optional character vector of non-rater context facets defining rating units. |
agreement_top_n |
Optional integer limiting displayed pairwise overlap rows. |
expected_design |
Optional score-free roster |
min_linking_persons |
Minimum shared persons treated as adequate pairwise rater linkage (default |
category_policy |
Optional category-gap handling policy ( |
repeated_ratings |
Policy for duplicate person-by-facet cells ( |
comparisons |
Optional subgroup comparison specification. |
spec |
Optional named specification list shared with |
Value
An S3 object of class "mfrm_data_description" supporting print() and summary(), containing design counts, category distributions, element exposure summaries, rater overlap tables, and structural missingness checks.
See Also
check_mfrm_connectivity, interrater_agreement, fit_mfrm
Examples
ratings <- load_mfrmr_data("example_operational")
desc <- describe_mfrm_data(
ratings,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score"
)
summary(desc)$overview
Screen Element Parameter Displacement and Anchor Drift Across Waves
Description
Compares common facet element location estimates across two or more separately calibrated administration waves against a designated reference wave, flagging elements with large absolute displacement (|Drift| > drift_threshold) or standardized displacement (|z| > flag_se_ratio).
Usage
detect_anchor_drift(
fits, facets = NULL, drift_threshold = 0.5, flag_se_ratio = 2,
reference = 1L, include_person = FALSE)
Arguments
fits |
Named or unnamed list of two or more fitted |
facets |
Optional character vector restricting drift screening to selected facets. |
drift_threshold |
Absolute logit displacement threshold for flagging (default |
flag_se_ratio |
Standardized |
reference |
Name or integer index of the reference wave in |
include_person |
Logical; whether to include common persons (default |
Details
Estimates must already share a meaningful scale, model and origin. This screen
does not estimate an equating transformation. The standard error is the square
root of the sum of the two marginal variances and assumes independent wave
estimates; repeated persons or overlapping ratings can violate that assumption.
When either calibration is not ready for inference, displacement is retained but
standard errors, tests and flags are unavailable. With include_person = TRUE,
common persons are included unless excluded by facets.
Value
An S3 object of class "mfrm_anchor_drift" containing table (per-element EstRef, EstWave, Drift, SE, z, pValue, Flagged, and Status) and reference.
See Also
anchor_to_baseline, fit_mfrm_drift
Examples
ratings <- load_mfrmr_data("example_core")
f1 <- fit_mfrm(subset(ratings, Group == "A"), "Person", c("Rater", "Criterion"), "Score")
f2 <- fit_mfrm(subset(ratings, Group == "B"), "Person", c("Rater", "Criterion"), "Score")
drift_chk <- detect_anchor_drift(list(Wave1 = f1, Wave2 = f2), facets = "Rater")
drift_chk$table
Compute Element Fit Diagnostics, Reliability, Separation, and Unexpected Cells
Description
Summarizes facet- and person-level measurement quality from a fitted Many-Facet model, including Infit and Outfit mean-square (MnSq) and standardized (ZSTD) fit statistics, ModelSE- vs RealSE-based separation, reliability, Strata, homogeneity chi-square tests, and standardized unexpected response cells (|StdResidual| >= 2).
Usage
diagnose_mfrm(
fit,
residual_pca = c("none", "overall", "facet", "both"),
pca_max_factors = 10L)
Arguments
fit |
A fitted model object returned by |
residual_pca |
Optional residual principal-components mode ( |
pca_max_factors |
Maximum number of residual PCA factors extracted when |
Details
Unified diagnostics include readiness, independently of optimizer
convergence. When unready, homogeneity tests are withheld (NA) and plots
omit interval bars; descriptive estimates and fit statistics remain available.
Summary/print output and plot notes retain the reasons, including after saving
and reloading the diagnostic object. Numerical readiness is not a guarantee
of interval coverage or fit-screening accuracy.
Residual PCA averages standardized residuals for each Person and selected facet
level or joint context. Results are exploratory. Missing or non-positive
semidefinite pairwise correlations are reported as unavailable. For example,
use plot(diagnose_mfrm(fit, residual_pca = "facet"), facet = "Criterion",
type = "residual_pca") to see the first contrast.
For primary EAP person scores, model reliability is
v/(v+s), where v is the sample variance of finite EAP estimates
(denominator n-1) and s is the mean squared posterior SD for the same
persons. Model separation is \sqrt{v/s}. This describes posterior score
separation conditional on the fitted calibration; it is not repeated-sample
classification accuracy. RealReliability substitutes the fit-inflated
RealSE and is a descriptive extension of that formula.
For WLE/JML person scores and facet estimates, true-score variance is estimated
as \max(0,v-s) and reliability as \max(0,v-s)/v.
ReliabilityBasis identifies which construction is used. Undefined
quantities remain NA.
Value
An S3 diagnostic bundle of class "mfrm_diagnostics" containing reliability (per-facet ModelReliability, RealReliability, ModelSeparation, RealSeparation, Strata, and HomogeneityChiSq), measures (element-level Estimate, ModelSE, RealSE, FairM, Infit, InfitZSTD, Outfit, OutfitZSTD), and unexpected (flagged rating rows sorted by |StdResidual|).
See Also
fit_mfrm, compute_person_fit_indices, fair_average_table, plot.mfrm_fit
Examples
ratings <- load_mfrmr_data("example_operational")
fit <- fit_mfrm(ratings, person = "Person", facets = c("Rater", "Criterion"), score = "Score")
diag <- diagnose_mfrm(fit)
# Inspect reliability/separation per facet and top unexpected rating rows
diag$reliability
head(diag$unexpected, 5)
summary(diag)
Legacy synthetic MFRM datasets inspired by Eckes and Jin (2021)
Description
Synthetic many-facet rating datasets in long format. All datasets include one row per observed rating.
Format
A data.frame with 5 columns:
- Study
Study label (
"Study1"or"Study2").- Person
Person/respondent identifier.
- Rater
Rater identifier.
- Criterion
Criterion facet label.
- Score
Observed category score.
Details
Available data objects:
-
ej2021_study1 -
ej2021_study2 -
ej2021_combined -
ej2021_study1_itercal -
ej2021_study2_itercal -
ej2021_combined_itercal
Naming convention:
-
study1/study2: separate simulation studies -
combined: row-bind of study1 and study2 -
_itercal: legacy synthetic sensitivity variant. These objects can differ in observed rows as well as scores and should not be interpreted as a controlled one-parameter recalibration.
Use load_mfrmr_data() for programmatic selection by key.
Data dimensions
| Dataset | Rows | Persons | Raters | Criteria |
| study1 | 1842 | 307 | 18 | 3 |
| study2 | 3287 | 206 | 12 | 9 |
| combined | 5129 | 307 | 18 | 12 |
| study1_itercal | 1842 | 307 | 18 | 3 |
| study2_itercal | 3341 | 206 | 12 | 9 |
| combined_itercal | 5183 | 307 | 18 | 12 |
Score range: 1–4 (four-category rating scale).
For the combined rows, Persons and Raters count unique raw labels.
Treating the two Study labels as distinct namespaces would instead give 513
person labels and 30 rater labels, but would leave two unlinked components.
Provenance and limits
These are legacy synthetic datasets whose stored responses reproduce the
dimensions described above. The exact response-generation code and random
seed are not available, so the objects must not be used as parameter-recovery
evidence or as evidence for a particular generating distribution. The
separately stored _itercal objects can differ in observed rows as well as
scores; they are legacy variants, not empirical calibration standards or a
controlled one-parameter recalibration.
Combined-data caution
The combined objects reuse P001–P206 and R01–R12 across the two
study labels. A combined analysis is meaningful only when those labels encode
an intended cross-study identity and an explicit anchor or linking design
establishes a common scale. Prefixing Person and Rater by Study removes
accidental label collisions, but it creates disconnected study components
and does not by itself establish a common scale. Analyze the studies
separately unless the linking design has been specified and reviewed. The
combined datasets are not beginner workflow examples or direct-fit examples.
Interpreting output
The study-specific datasets are in long format and can be passed to
fit_mfrm() after confirming column-role mapping. The combined objects
require a reviewed identity and anchor/linking design before a joint fit;
row-binding or prefixing identifiers alone does not create a common scale.
Typical workflow
Inspect available datasets with
load_mfrmr_data("list").Load one dataset using
load_mfrmr_data().Fit and diagnose with
fit_mfrm()anddiagnose_mfrm().
Source
Simulated for this package with design settings informed by Eckes and Jin (2021). The Eckes & Jin (2021) Method section reports the following design parameters that motivated the synthetic versions shipped here: Study 1 had 307 examinees (149 males, 158 females), 18 raters (4 males, 14 females), and 3 criteria (global impression, task fulfillment, linguistic realization) on a 4-category rating scale (TDN levels rescored 1-4); Study 2 had 206 examinees (66 males, 140 females), 12 raters (1 male, 11 females), and 9 criteria on the same 4-category scale. The packaged datasets reproduce these (examinees, raters, criteria, categories) shapes but use simulated responses, so they are not the real TestDaF data.
References
Eckes, T., & Jin, K.-Y. (2021). Measuring rater centrality effects in writing assessment: A Bayesian facets modeling approach. Psychological Test and Assessment Modeling, 63(1), 65–94.
Examples
data("ej2021_study1", package = "mfrmr")
head(ej2021_study1)
table(ej2021_study1$Study)
Estimate 2-Way and All-Pairs Facet Bias with FACETS 4.5.3 RajuSA-Welch Contrasts
Description
Computes fast C++ fixed-measure 2-way local bias tables (FACETS Table 13) and pairwise contrasts (Table 14) for one facet pair or interaction_facets = "all", defaulting to the FACETS 4.5.2/4.5.3 RajuSA-Welch integer-truncated Welch-Satterthwaite degrees of freedom (von Davier, 2025; Raju, 1990), or fits a joint C++ interaction model with omnibus likelihood-ratio test when method = "joint".
Usage
estimate_bias(
fit, facet_a = NULL, facet_b = NULL,
interaction_facets = NULL, method = c("local", "joint"),
df_method = c("facets", "classical"), p_adjust = "holm")
Arguments
fit |
A fitted model object returned by |
facet_a |
Optional character string naming the first interaction facet. |
facet_b |
Optional character string naming the second interaction facet. |
interaction_facets |
Character vector of two facet names, or |
method |
|
df_method |
Degrees-of-freedom convention for pairwise contrasts: |
p_adjust |
Multiple-testing adjustment method passed to |
Details
Local GPCM calculations retain the fitted observation discrimination products and the chosen full-predictor or ability-only formula. Their cell curvature SEs condition on the calibration and person estimates; pairwise SEs combine these conditional cell errors. They do not propagate calibration uncertainty or guarantee finite-sample coverage. RajuSA-Welch labels identify the contrast/df convention, not independent validation of every GPCM extension.
Joint refits append only the declared zero-margin interaction to the source
encoding, retaining weights, anchors/constraints, population covariates,
discrimination specification and numerical controls. An already included
interaction or an empirically shrunk source is rejected. The omnibus LRT is
returned only when the common nested-likelihood checks used by anova()
are satisfied; otherwise lrt is NULL and
comparison_basis explains the restriction.
InferenceStatus and InferenceReason accompany the screening rows.
Unready calibrations retain descriptive estimates but return NA for
interval SEs and p-values. All-unavailable screen counts are NA, not zero.
Numerical readiness is not a guarantee of coverage or diagnostic accuracy.
Older saved calibrations require refitting with the current fit_mfrm().
Value
An S3 object of class c("mfrm_bias", "mfrm_bundle") containing table (cell-level bias estimates, BiasSE, t, df, pValue, pAdj), pairwise (pairwise context contrasts with TestType, df, dfUnrounded, pAdj), summary, and (when method = "joint") lrt and joint_fit.
See Also
fit_mfrm, analyze_dff, plot.mfrm_fit
Examples
# Screen planted Rater x Criterion interaction (R04 x Accuracy) in example_bias
ratings <- load_mfrmr_data("example_bias")
fit <- fit_mfrm(ratings, person = "Person", facets = c("Rater", "Criterion"), score = "Score")
bias <- estimate_bias(fit, interaction_facets = c("Rater", "Criterion"), df_method = "facets")
head(bias$table[order(-abs(bias$table$t)),
c("LevelA", "LevelB", "ObsExpAvg", "BiasSize", "BiasSE", "t", "pAdj")], 5)
plot(bias, type = "forest")
Compute Reference-Standardized Fair(M) and Zero-Reference Fair(Z) Expected Scores
Description
Translates latent logit parameter estimates for persons and non-person facets back onto the original rubric score scale by computing model-expected average ratings against a cohort-mean reference context (FairM) and a zero-logit reference context (FairZ), alongside raw observed averages (ObsAvg).
Usage
fair_average_table(fit, diagnostics = NULL, facets = NULL, umean = 0,
uscale = 1, fair_se = FALSE, ci_level = 0.95, reference_plan = NULL)
Arguments
fit |
A fitted model object returned by |
diagnostics |
Optional precomputed |
facets |
Optional character vector filtering which facets (including |
umean |
Additive origin shift applied to reported logit measures |
uscale |
Multiplicative scale factor applied to reported logit measures and |
fair_se |
Logical; request uncertainty. Supply a common |
ci_level |
Confidence level in |
reference_plan |
Optional common rating plan |
Details
Printing shows the common-plan reference_scores, including conditional
intervals when requested, before the observed-design Fair(M) tables.
Observed-design Fair(M) uses finite facet-level means, an observation-weighted
geometric reference discrimination for GMFRM, and each person's weighted
step-group mix. A geometric-mean-one identification constraint is not itself a
reference-panel definition. Use an explicit reference_plan to compare
people or models against the same specified rating plan.
confint(x, level = 0.95) returns these conditional person-score
intervals for a fair-average table with a reference plan. These intervals hold
calibration parameters fixed; they do not propagate estimated-anchor or
calibration uncertainty. Legacy refit-bootstrap and joint-delta arguments are
not supported by this method.
For the unified engine, reference_scores$Estimate is the weighted mean
model-expected rating under the same supplied plan for every person, conditional
on that person's primary ability estimate. It is on the original rubric scale
(Units = "original_score"). The plan preserves the fitted locations,
steps, interactions and slopes; its scores can therefore differ from FairM/FairZ.
An EAP plug-in score is not the posterior mean of the transformed score.
With fair_se = TRUE, the unified engine transforms the endpoints of
a normal interval for the primary person measure under the supplied plan. For
EAP these are conditional normal posterior approximations. Calibration and plan
weights are held fixed. The point estimate remains a plug-in expected score.
Unavailable bounds remain NA with an uncertainty status. The SE
column in the facet table stays on the latent measure scale.
Value
An S3 object of class "mfrm_fair_average" containing stacked (combined data.frame with Facet, Level, ObsCount, ObsAvg, ExpAvg, FairM, FairZ, Measure, and SE) and raw_by_facet (named list of per-facet data.frames).
When a plan is supplied, also returns reference_plan with
NormalizedWeight, and reference_scores with one person per row.
See Also
Examples
# Compare raw observed averages (ObsAvg) against rater-adjusted Fair(M) on incomplete panels
ratings <- load_mfrmr_data("example_operational")
fit <- fit_mfrm(ratings, person = "Person", facets = c("Rater", "Criterion"), score = "Score")
fair <- fair_average_table(fit, facets = c("Person", "Rater"))
head(fair$raw_by_facet$Person, 5)
fair$raw_by_facet$Rater
# Put every person on the same weighted panel (original score scale).
plan <- data.frame(Rater = c("R01", "R04"),
Criterion = c("Content", "Language"), Weight = c(1, 3))
head(fair_average_table(fit, reference_plan = plan)$reference_scores)
Estimate Many-Facet Ordered-Response Measurement Models (RSM, PCM, and GMFRM)
Description
Primary estimation entry point for Rating Scale ("RSM"), Partial Credit ("PCM"), and Generalized Many-Facet Rasch Models (GMFRM, selected with model = "GPCM") across Marginal ("MML"), Joint ("JML"), Jeffreys-penalized Joint ("JML_jeffreys"), and Conditional ("CML") Maximum Likelihood in C++. Supports element and group-mean anchors, fixed or shared step_constraints, declarative category_support for mixed binary/polytomous rubrics, explanatory facet_formulas with element covariates, joint facet_interactions, empirical Bayes or Laplace facet_shrinkage, Warm's (1989) WLE scoring, and automatic pre-estimation connectivity and identifiability checks.
Usage
fit_mfrm(
data, person = NULL, facets = NULL, score = NULL,
model = c("RSM", "PCM", "GPCM"),
method = c("MML", "JML", "JMLE", "JML_jeffreys", "CML"),
step_facet = NULL, slope_facet = NULL, rating_min = NULL,
rating_max = NULL, weight = NULL, anchors = NULL, group_anchors = NULL,
population_formula = NULL, person_data = NULL, facet_interactions = NULL,
step_constraints = NULL, category_support = NULL, facet_formulas = NULL,
facet_data = NULL, person_score = c("auto", "EAP", "WLE"),
warn_connectivity = TRUE, spec = NULL, control = list(), ...)
Arguments
data |
A |
person |
Character string naming the person (examinee/target) identifier column. |
facets |
Character vector naming one or more non-person facet columns (e.g., |
score |
Character string naming the integer or numeric rubric score column. Convert factor labels to numeric rubric values before using the unified engine. |
model |
|
method |
Estimation method: |
step_facet |
Character string naming the facet in |
slope_facet |
Character vector of length 1 or 2 naming the facet(s) in |
rating_min |
Optional integer lower bound of the rubric scale. Inferred from observed scores if |
rating_max |
Optional integer upper bound of the rubric scale. Inferred from observed scores if |
weight |
Optional character string naming a nonnegative observation case-weight column in |
anchors |
Optional |
group_anchors |
Optional |
population_formula |
Optional one-sided latent-regression formula (e.g., |
person_data |
Optional |
facet_interactions |
Optional list of length-2 character vectors (e.g., |
step_constraints |
Optional |
category_support |
Optional |
facet_formulas |
Optional named list of one-sided covariate formulas (e.g., |
facet_data |
Optional named list of element-level covariate |
person_score |
Primary person ability estimator stored in |
warn_connectivity |
Logical; if |
spec |
Optional named list of advanced model specification settings, including |
control |
Optional named list of numerical and regularization controls, including |
... |
Additional supported specification or control arguments, supplied by name. In particular, |
Details
Use the named main arguments for the data and model, spec for
advanced model assumptions, and control for numerical settings.
Additional named arguments in ... are retained for compatibility;
do not specify the same setting in both places.
Non-unit observation weights leave point estimates available but withhold inferential reporting because the supported weight interpretation has not been validated. A deficit in the constrained facet-location design after projecting out centered person-location contrasts is also flagged: MML comparisons then rely on population assumptions when effective anchors do not resolve the deficit. This conditional location check is not a proof of global identifiability for all nonlinear slope or threshold structures.
All estimators return the same mfrm_fit schema and work with
mfrm_workflow(fit = ...). The implementation is selected internally;
there is no engine-selection argument. Refit saved objects from older versions
using their original data and model specification. Relabelling their class
does not convert the underlying parameter and covariance layout.
With mml_integration = "auto", fixed quadrature fits at q and
2q+1 points are compared. The finer fit is returned. Relative free-parameter
changes, absolute expected-score changes, and log-likelihood changes per rating
are checked against 1e-4, 1e-4, and 1e-6, respectively.
The results and selected order are retained in quadrature_check.
A failed check withholds inferential reporting; increase quad_points and
inspect stability. Agreement at these two orders is a sensitivity check, not a
bound on integration error, global-optimum guarantee, or coverage validation.
The Generalized Many-Facet Rasch Model (GMFRM) is a unidimensional adjacent-category model that estimates discrimination. The name follows Uto and Ueno (2020), who use GMFRM for an extension of the many-facet Rasch model. In the ordinary many-facet Rasch model, discrimination is held constant. In this package, GMFRM covers a many-facet generalized partial credit model (GPCM; Muraki, 1992) with facet-specific category steps and a rating-scale form (many-facet RS-GPCM) with common category steps. These descriptions refer to the fitted step structure. The response equation depends on the step ownership and slope placement selected for the analysis.
Reports name the facets that carry discrimination. When two facets
carry discrimination, their slopes are multiplied. Report the step facet,
slope placement, scale identification, and estimation method when
describing the fitted model. summary(fit)$model_label gives the
display label for a fitted model; the model code is "GPCM".
Converged reports the optimizer stopping condition. Separately,
summary$InferenceReady and readiness$reason_codes report failed
connectivity, convergence, finite-parameter, or positive-definite information checks.
For unified RSM and PCM MML, the population location terms must be
identifiable together with the constrained facet effects. A rank-deficient
joint design cannot identify these effects separately. Recheck the rating
assignments, fixed reference values and population formula.
For unpenalized RSM/PCM MML, boundary_audit uses the required dependency lpSolve
to seek a structural direction that improves every observed category probability
without changing person ability. A certified direction implies no finite structural
MLE and makes inference unavailable. Failure to find this sufficient condition is
not a general proof of existence; GPCM boundaries and all population-boundary
directions are not covered by this particular test. An unsuccessful numerical boundary check keeps inference unavailable. These checks do not establish finite-sample coverage.
Person and facet fit statistics, expected averages, FairM/FairZ, and local-bias
diagnostics use the primary person score. Selecting MML person_score = "WLE"
therefore changes these derived quantities as well as person$Estimate;
the EAP and posterior SD remain available in separate columns.
Value
An object of class "mfrm_fit" containing:
-
person:data.frameof person ability estimates (Estimate,ModelSE,RealSE,WLE,WLE_SE,FairM,FairZ,InfitMnSq,OutfitMnSq,ExtremeFlag). -
facets:data.frameof non-person facet location estimates,ModelSE,RealSE,SandwichSE,FairM, and fit statistics. -
steps:data.frameof Andrich step threshold estimates andModelSE. -
slopes:data.frameof GPCM discrimination estimates (Estimate,LogEstimate,ModelSE,SandwichSE) whenmodel = "GPCM". -
population,connectivity,summary: latent distribution summary, connectivity audit, and model fit indices (loglik,aic,bic).
Supports summary(), plot(), predict(), coef(), vcov(), confint(), anova(), logLik(), AIC(), BIC(), fitted(), and residuals().
References
Muraki, E. (1992). A generalized partial credit model: Application of an EM algorithm. Applied Psychological Measurement, 16(2), 159–176. doi:10.1177/014662169201600206.
Uto, M., and Ueno, M. (2020). A generalized many-facet Rasch model and its Bayesian estimation using Hamiltonian Monte Carlo. Behaviormetrika, 47, 469–496. doi:10.1007/s41237-020-00115-7.
See Also
mfrm_analysis, check_mfrm_connectivity, diagnose_mfrm, estimate_bias, analyze_dff, plot.mfrm_fit
Examples
# Load bundled 4-rater x 4-criterion analytic rubric ratings (1 row = 1 rating)
ratings <- load_mfrmr_data("example_core")
# 1. Rating Scale Model (RSM) via MML with Warm's WLE person scoring
fit_rsm <- fit_mfrm(
ratings,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score",
model = "RSM",
method = "MML",
person_score = "WLE"
)
fit_rsm$facets[, c("Facet", "Level", "Estimate", "RealSE", "FairM", "InfitMnSq")]
# 2. GMFRM with criterion-specific discrimination
fit_gpcm <- fit_mfrm(
ratings,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score",
model = "GPCM",
step_facet = "Criterion",
slope_facet = "Criterion",
control = list(quad_points = 21L)
)
fit_gpcm$slopes[, c("Facet", "Level", "Estimate", "ModelSE")]
predict(fit_gpcm, newdata = data.frame(theta = 0, Rater = "R01", Criterion = "Content"))
Estimate Dynamic Multi-Wave and Markov Rater Severity Drift Models
Description
Estimates non-Bayesian dynamic rater-severity drift across ordered scoring waves, sessions, or days without MCMC sampling (generalized from Uto, 2023). Integrates person abilities by normal quadrature, computes analytical Louis (1982) observed information for inner parameters, and estimates rater-specific random-walk drift standard deviations by Laplace-marginalized Empirical Bayes with Kass-Steffey (1989) hyperparameter variance propagation (TotalSE vs ConditionalSE).
Usage
fit_mfrm_drift(
data, person, rater, time, score, facets = character(),
score_levels = NULL, model = c("PCM", "RSM"),
drift_mode = c("markov_hetero", "markov_homo", "independent", "static"),
eb_method = c("em_laplace", "full_laplace"), mu_sigma = -2,
delta_sigma = 1, beta1_sd = 1, step_sd = 1, person_sd = 1,
logistic_scale = 1, quad_points = 81L, maxit = 60L, tol = 1e-06,
missing = c("fail", "omit"), drift_threshold = 0.3, flag_se_ratio = 2)
Arguments
data |
A |
person |
Character string naming the person identifier column. |
rater |
Character string naming the rater identifier column whose severity may drift over |
time |
Character string naming the ordered scoring wave, session, or day column. |
score |
Character string naming the ordered rubric score column. |
facets |
Optional character vector of additional time-invariant non-person facets (e.g., |
score_levels |
Optional sorted numeric/integer vector declaring the full ordered rubric categories. |
model |
Category threshold structure: |
drift_mode |
Temporal severity specification: |
eb_method |
Hyperparameter optimization method: |
mu_sigma |
Prior mean for log-drift standard deviations (default |
delta_sigma |
Prior SD for log-drift standard deviations (default |
beta1_sd |
Prior SD for initial Wave-1 rater severities (default |
step_sd |
Weak regularizing prior SD on step parameters (default |
person_sd |
Standard deviation of the normal person ability distribution (default |
logistic_scale |
Multiplicative scale constant (default |
quad_points |
Number of normal quadrature grid points for person integration (default |
maxit |
Maximum outer optimization iterations (default |
tol |
Relative convergence tolerance (default |
missing |
Missing-value handling: |
drift_threshold |
Absolute logit change threshold used to flag substantive wave-to-wave drift (default |
flag_se_ratio |
Standardized |
Value
An S3 object of class "mfrm_drift" supporting summary(), plot(), confint(), coef(), vcov(), predict(), and as.data.frame(x, component = "severity") (returning rater-by-wave severity estimates, ConditionalSE, TotalSE, and drift flags).
See Also
fit_mfrm, detect_anchor_drift, plot.mfrm_fit
Examples
ratings <- load_mfrmr_data("example_core")
ratings$Wave <- ifelse(as.integer(factor(ratings$Person)) <= 24L, "Day1", "Day2")
drift_fit <- fit_mfrm_drift(
ratings,
person = "Person",
rater = "Rater",
time = "Wave",
score = "Score",
facets = "Criterion",
model = "RSM"
)
as.data.frame(drift_fit, component = "severity")
plot(drift_fit, type = "trajectory")
Format a Tidy Many-Facet Summary Table with Optional kableExtra or flextable
Description
Extracts a tidy summary table from a tidymfrm workflow via tidy() and
formats it as GitHub-flavored Markdown, HTML (kableExtra), or Word/Office
(flextable).
Usage
format_mfrm_table(
x,
component = c("raters", "facets", "persons", "steps", "slopes", "g_study", "d_study",
"dff", "drift"),
engine = c("markdown", "kableExtra", "flextable"),
digits = 3L
)
Arguments
x |
A |
component |
Component to format: |
engine |
Table engine: |
digits |
Number of decimal places for numeric columns (default |
Value
A Markdown string, kableExtra object, or flextable object.
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
ratings <- load_mfrmr_data(saved$dataset)
wf <- mfrm_workflow(ratings, "Person", c("Rater", "Criterion"), "Score",
fit = saved$fit) |>
step_mfrm_diagnose()
cat(format_mfrm_table(wf, component = "raters", engine = "markdown"))
Glance at a Single-Row Summary of a Many-Facet Workflow or Fit
Description
Returns a one-row tibble summarizing graph connectivity, model convergence and inference readiness,
information criteria, latent EAP reliability, observed-score G and Phi,
and flagged rater counts.
Usage
glance(x, ...)
## S3 method for class 'tidymfrm'
glance(x, ...)
## S3 method for class 'mfrm_fit'
glance(x, ...)
Arguments
x |
A |
... |
Additional arguments (unused). |
Value
A single-row tibble::tibble(). model
is the API code and model_label gives the display name, including
the facets carrying discrimination for a GMFRM.
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
ratings <- load_mfrmr_data(saved$dataset)
wf <- mfrm_workflow(ratings, "Person", c("Rater", "Criterion"), "Score",
fit = saved$fit)
glance(wf)
Compute Exact, Weighted Kappa, Gwet AC2, Krippendorff Alpha, and ICC Agreement
Description
Consolidates exact and adjacent agreement, pairwise weighted kappa, Gwet's ordinal AC_2, Krippendorff's \alpha, and two-way random intraclass correlation (ICC(2,1) and ICC(2,k)) from raw rating tables or fitted mfrm_fit objects.
Usage
interrater_agreement(
data, person = "Person", rater = "Rater", score = "Score",
context_facets = NULL, unit = NULL, categories = NULL,
metric = c("all", "exact", "kappa", "gwet_ac2", "krippendorff_alpha", "icc"),
weights = c("quadratic", "linear", "unweighted"), model_expected = FALSE
)
Arguments
data |
A |
person |
Character string naming the person identifier column. |
rater |
Character string naming the rater identifier column. |
score |
Character string naming the numeric rating column. |
context_facets |
Optional character vector of additional facets identifying rating units. |
unit |
Optional character vector specifying the full unit identifier columns (e.g., |
categories |
Optional numeric vector of declared rubric score categories (e.g., |
metric |
Agreement family: |
model_expected |
Logical. For a unified-engine fit, also compute observed and expected rates and model-based exact kappa on the same usable pairs. |
weights |
Weighting scheme: |
Details
Model expectation is the product of the two fitted category probability vectors, conditional on each fitted person's primary score and independent ratings. Complete unit-rater pairs with valid probabilities contribute equally. The model table records pair counts and availability. The ordinary weighted kappa uses marginal category frequencies.
Each unit-rater combination must have at most one observed rating. Duplicate
combinations are rejected to prevent row-order-dependent overwriting. For repeated
occasions, include the occasion column in unit or context_facets
so that the comparison refers to the intended rating occasion.
Value
A structured mfrmr S3 object or data.frame containing parameter estimates, standard errors, and diagnostic summaries.
Examples
ratings <- load_mfrmr_data("example_core")
interrater_agreement(ratings, person = "Person", rater = "Rater",
score = "Score", context_facets = "Criterion")
Load Bundled Synthetic Many-Facet Example Datasets
Description
Returns one of the synthetic many-facet rating datasets bundled with mfrmr as a ready-to-use data.frame for learning, testing, and reproducible examples.
Usage
load_mfrmr_data(name = "example_core", details = FALSE)
Arguments
name |
Dataset key, or |
details |
With |
Value
A data frame for the selected dataset, a character vector of keys, or a catalogue data frame.
The rating datasets contain person/facet identifiers and observed scores. The
example_gtheory_crossed and example_gtheory_nested tables contain
separate Content and Organization outcomes. The
example_agreement table identifies units by Person and Task. The
example_operational_design table is a planned roster without scores.
Inspect column roles before fitting; these different table types are not
interchangeable inputs to fit_mfrm().
See Also
mfrmr_example_data, ej2021_data, describe_mfrm_data
Examples
load_mfrmr_data("list", details = TRUE)
ratings <- load_mfrmr_data("example_operational")
head(ratings)
table(ratings$Rater, ratings$Score)
Extract Direct Calibration Anchor Tables from a Fitted Model
Description
Extracts converged facet element location estimates (and optionally person estimates) from a baseline fit_mfrm object in the data.frame(Facet, Level, Anchor) format accepted by the anchors argument of subsequent fit_mfrm calibrations.
Usage
make_anchor_table(
fit, facets = NULL, include_person = FALSE, digits = NULL,
readiness_policy = c("error", "review"))
Arguments
fit |
A fitted baseline model object returned by |
facets |
Optional character vector of non-person facet names to include; defaults to all non-person facets. |
include_person |
Logical; if |
digits |
Optional integer rounding precision applied to |
readiness_policy |
|
Value
A data.frame (or tibble) with columns Facet, Level, and Anchor.
See Also
anchor_to_baseline, detect_anchor_drift, fit_mfrm
Examples
ratings <- load_mfrmr_data("example_core")
fit_base <- fit_mfrm(ratings, person = "Person", facets = c("Rater", "Criterion"), score = "Score")
anchors <- make_anchor_table(fit_base, facets = "Criterion")
anchors
One-Stop End-to-End Many-Facet Measurement, Generalizability, and Audit
Description
Executes the complete three-pillar performance-assessment workflow in a single call:
-
Connectivity & Many-Facet Measurement: Verifies multi-facet graph connectivity and fits
RSM,PCM, or a Generalized Many-Facet Rasch Model (GMFRM, selected withmodel = "GPCM") viaMML,JML,JML_jeffreys, orCMLin C++ (EAPand Warm'sWLE, optional dynamic Markov rater drift viaoccasion,step_constraints,category_support, and explanatoryfacet_formulas). -
G-Study & D-Study Planning: Decomposes observed rating variance (
urGENOVAHenderson Method 1 across crossed, nested, and multivariate composite designs) and identifies minimal designs meeting targetGand\Phi. -
Rater Diagnostics, Fair(M), Real SE, Bias, & DFF Screening: Flags noisy/central/severe raters, computes
RajuSA-Welchpairwise bias, extracts unexpected ratings, and optionally screens group-level DFF and cutoffs.
Usage
mfrm_analysis(
data,
person,
facets,
score,
model = c("RSM", "PCM", "GPCM"),
method = c("MML", "JML", "JML_jeffreys", "CML"),
step_facet = NULL,
slope_facet = NULL,
slope_reference = NULL,
slope_type = c("full_predictor", "ability_only"),
slope_prior_sd = NULL,
occasion = NULL,
person_score = c("auto", "EAP", "WLE"),
rater_facet = NULL,
rating_min = NULL,
rating_max = NULL,
compare_methods = NULL,
population_formula = NULL,
person_data = NULL,
step_constraints = NULL,
category_support = NULL,
facet_formulas = NULL,
facet_data = NULL,
quad_points = 31L,
mml_integration = c("fixed", "adaptive"),
xtreme = 0.3,
warn_connectivity = TRUE,
nesting = NULL,
g_scores = NULL,
g_weights = NULL,
d_study_grid = NULL,
target_g = 0.8,
target_phi = 0.8,
mnsq_range = c(0.7, 1.3),
zstd_limit = 2,
bias_df_method = c("facets", "classical"),
dff_group = NULL,
dff_method = c("mml_lrt", "cml_lrt", "raju_welch", "mh", "logistic"),
cut_scores = NULL,
bootstrap = 0L,
threads = 1L,
gpcm_mml_identification = NULL,
g_facets = NULL,
expected_design = NULL,
rater_panels = NULL,
g_data = NULL
)
tidymfrm(
data,
person,
facets,
score,
model = c("RSM", "PCM", "GPCM"),
method = c("MML", "JML", "JML_jeffreys", "CML"),
step_facet = NULL,
slope_facet = NULL,
slope_reference = NULL,
slope_type = c("full_predictor", "ability_only"),
slope_prior_sd = NULL,
occasion = NULL,
person_score = c("auto", "EAP", "WLE"),
rater_facet = NULL,
rating_min = NULL,
rating_max = NULL,
compare_methods = NULL,
population_formula = NULL,
person_data = NULL,
step_constraints = NULL,
category_support = NULL,
facet_formulas = NULL,
facet_data = NULL,
quad_points = 31L,
mml_integration = c("fixed", "adaptive"),
xtreme = 0.3,
warn_connectivity = TRUE,
nesting = NULL,
g_scores = NULL,
g_weights = NULL,
d_study_grid = NULL,
target_g = 0.8,
target_phi = 0.8,
mnsq_range = c(0.7, 1.3),
zstd_limit = 2,
bias_df_method = c("facets", "classical"),
dff_group = NULL,
dff_method = c("mml_lrt", "cml_lrt", "raju_welch", "mh", "logistic"),
cut_scores = NULL,
bootstrap = 0L,
threads = 1L,
gpcm_mml_identification = NULL,
g_facets = NULL,
expected_design = NULL,
rater_panels = NULL,
g_data = NULL
)
Arguments
data |
A |
person |
Character string naming the person identifier column. |
facets |
Character vector of non-person facet column names (e.g., |
score |
Character string naming the numeric rating column. |
model |
|
method |
Primary estimation method: |
step_facet |
Facet owning category thresholds when |
slope_facet |
Facet(s) owning discrimination slopes when |
slope_reference |
Reference slope facet constrained to geometric mean 1 when two facets have discrimination parameters. |
slope_type |
GPCM parameterization: |
slope_prior_sd |
Optional log-normal prior SD regularizing GPCM log-slopes. |
occasion |
Optional character string naming the rating occasion/wave column for Markov rater drift modeling. |
person_score |
|
rater_facet |
Optional character string naming the rater facet; inferred automatically if |
rating_min, rating_max |
Optional integer rubric bounds. |
rater_panels |
Optional named character vector assigning rater IDs to panels for effective resistance. |
g_data |
Optional separate rating table for the G-Study, such as one row per person and rater with scores in multiple columns. The measurement fit uses |
expected_design |
Optional score-free roster of planned rating cells. The workflow reports planned cells without observed scores and observed cells outside the roster. |
compare_methods |
Optional character vector of additional estimators
(e.g., |
population_formula |
Optional latent-regression formula for |
person_data |
Optional person-level covariate table with one row per person ID. |
step_constraints |
Optional step-constraint declarations ( |
category_support |
Optional per-level category support bounds ( |
facet_formulas, facet_data |
Optional explanatory facet covariate formulas and tables with one row per element ID. |
quad_points |
Quadrature points for |
mml_integration |
|
xtreme |
Extreme-score adjustment for |
warn_connectivity |
Logical; if |
nesting |
Optional named character vector |
g_facets |
Optional facet vector for G-Study (defaults to all workflow facets). Supply a subset explicitly if the workflow has more than four facets. |
g_scores |
Optional character vector of score columns for multivariate G-Study. |
g_weights |
Optional nonnegative composite weights matching |
d_study_grid |
Optional candidate design grid |
target_g |
Target generalizability coefficient |
target_phi |
Target dependability index |
mnsq_range |
Acceptable |
zstd_limit |
Absolute |
bias_df_method |
Degrees-of-freedom convention for 2-way pairwise bias
screening: |
dff_group |
Optional person-group column name in |
dff_method |
DFF estimator when |
cut_scores |
Optional finite numeric |
bootstrap |
Number of conditional parametric bootstrap replications
( |
threads |
Number of C++ worker threads for |
gpcm_mml_identification |
Optional scale identification for GPCM MML.
Use |
Details
Use vignette("mfrmr-workflow", package = "mfrmr") for a
first analysis and a guide to familiar FACETS outputs. If the G-Study
design yields unavailable variance components, the workflow warns, retains the
calibration and rating diagnostics, and stores the reason in
summary(wf)$gtheory_reason. Supply g_facets to declare a subset
for planning when the full design contains more than four non-person facets.
The connectivity summary uses the category support of the fitted calibration.
Value
A completed tidymfrm object supporting summary(), plot(),
predict(), coef(), vcov(), confint(), tidy(), glance(),
augment(), and render_mfrm_report().
Examples
utils::data("mfrmr_example_core", package = "mfrmr")
wf <- mfrm_analysis(
mfrmr_example_core,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score",
method = "MML",
cut_scores = c(2.5, 3.0)
)
summary(wf)$rater_diagnostics
predict(wf, newdata = data.frame(theta = 0, Rater = "R01", Criterion = "Content"))
Multi-Threaded C++ Batch MFRM Estimator for Monte Carlo and Bootstrap Studies
Description
Executes tens to thousands of Many-Facet model calibrations, person scorings, and fit diagnostics in parallel across native C++ std::thread workers without R interpreter or garbage-collection contention. Accepts either a shared template data.frame paired with a replicated score_matrix (nrow(data) x R) or a list of heterogeneous rating data.frames.
Usage
mfrm_batch_fit(
data, person, facets, score = "score", score_matrix = NULL,
model = c("RSM", "PCM", "GPCM"),
method = c("MML", "JML", "JML_jeffreys", "CML"),
step_facet = NULL, slope_facet = NULL, slope_reference = NULL,
slope_type = c("full_predictor", "ability_only"),
gpcm_mml_identification = c("free_population",
"fixed_standard_normal", "unconstrained_slopes"),
person_score = c("auto", "EAP", "WLE"),
rating_min = NULL, rating_max = NULL, anchors = NULL,
group_anchors = NULL, dummy_facets = NULL,
population_formula = NULL, person_data = NULL, step_constraints = NULL,
category_support = NULL, facet_formulas = NULL, facet_data = NULL,
slope_prior_sd = NULL, quad_points = 31L,
mml_integration = c("fixed", "adaptive"), xtreme = 0,
whexact = FALSE, bias_facets = NULL, maxit = 400L, reltol = 1e-10,
threads = 1L, return_fits = TRUE)
Arguments
data |
A template |
person |
Character string naming the person identifier column. |
facets |
Character vector of non-person facet column names. |
score |
Character string naming the numeric rating column. |
score_matrix |
Optional integer/numeric matrix ( |
model |
|
method |
Estimation method ( |
step_facet |
Facet owning thresholds when |
slope_facet |
Facet(s) owning discrimination slopes when |
slope_reference |
Reference slope facet constrained to geometric mean 1 in 2-family |
slope_type |
GPCM parameterization: |
gpcm_mml_identification |
Scale identification rule for GPCM MML estimation. |
person_score |
Primary person ability estimator ( |
rating_min |
Minimum integer rubric score. |
rating_max |
Maximum integer rubric score. |
anchors |
Optional element anchor table. |
group_anchors |
Optional group-mean anchor table. |
dummy_facets |
Optional dummy facets fixed at 0. |
population_formula |
Optional latent-regression formula for |
person_data |
Optional person covariate |
step_constraints |
Optional step-constraint declarations. |
category_support |
Optional per-level category support bounds. |
facet_formulas |
Optional explanatory facet covariate formulas. |
facet_data |
Optional covariate tables for explanatory facets. |
slope_prior_sd |
Optional log-normal prior SD regularizing GPCM log-slopes. |
quad_points |
Gauss-Hermite quadrature points for |
mml_integration |
Integration mode ( |
xtreme |
Extreme-score adjustment for |
whexact |
Logical flag for exact Wilson-Hilferty |
bias_facets |
Optional length-2 character vector for 2-way local bias. |
maxit |
Maximum optimization iterations (default |
reltol |
Relative convergence tolerance (default |
threads |
Number of C++ worker threads (default |
return_fits |
Logical; if |
Value
A list of mfrm_fit objects (when return_fits = TRUE) or a data.frame of replication convergence, iteration counts, and log-likelihoods (when return_fits = FALSE), with attribute "elapsed_sec".
See Also
Examples
ratings <- load_mfrmr_data("example_core")
fit <- fit_mfrm(ratings, "Person", c("Rater", "Criterion"), "Score", method = "CML")
# Simulate 4 parametric bootstrap replications from fitted category probabilities
probs <- fitted(fit, type = "probs")
cats <- as.integer(colnames(probs))
set.seed(123)
sim_mat <- replicate(4L, vapply(seq_len(nrow(probs)), function(i) {
sample(cats, 1L, prob = probs[i, ])
}, integer(1)))
mfrm_batch_fit(
ratings,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score",
score_matrix = sim_mat,
method = "CML",
rating_min = 1,
rating_max = 4,
threads = 1L,
return_fits = FALSE
)
Project Decision-Study Generalizability (G), Dependability (Phi), and SEM
Description
Projects universe-score variance, relative error variance, absolute error variance, relative and absolute SEM, generalizability coefficient (G), and dependability index (\Phi) across candidate facet sample sizes (design_grid) from an estimated mfrm_g_study or fit_mfrm object.
Usage
mfrm_d_study(
x, design_grid = NULL, ...)
Arguments
x |
An estimated G-Study object returned by |
design_grid |
Optional |
... |
Additional arguments forwarded to methods (such as |
Details
For urgenova, GStatus/PhiStatus identify availability.
Zero total variance makes the coefficient undefined (NA), not zero;
its MeetsG80/MeetsPhi80 flag is also NA.
Negative universe or projected error variance likewise makes the associated
coefficient unavailable. A zero universe variance with positive error variance
is a defined coefficient of zero. Negative error variance yields NA SEM.
Default and explicit plans use the same calculations, including for saved fits.
Value
A data.frame (for method = "urgenova" G-Studies) or "mfrm_multivariate_d_study" object reporting candidate facet counts, TotalRatingsPerPerson, UniverseVar, RelErrorVar, AbsErrorVar, RelSEM, AbsSEM, G, and Phi.
See Also
Examples
ratings <- load_mfrmr_data("example_core")
gt <- mfrm_g_study(
ratings,
scores = "Score",
person = "Person",
facets = c("Rater", "Criterion"),
method = "urgenova"
)
# Compare 1-to-3 raters crossed with 2 or 4 criteria
mfrm_d_study(gt, design_grid = expand.grid(Rater = 1:3, Criterion = c(2, 4)))
Estimate Univariate and Multivariate Generalizability Study Variance Components
Description
Estimates variance and covariance components for balanced or unbalanced crossed and nested rating designs using Henderson Method 1 (method = "urgenova"), ANOVA, or MINQUE(0).
Usage
mfrm_g_study(
data, scores = NULL, person = "Person", rater = "Rater", task = "Task",
method = c("anova", "minque0", "urgenova"), missing = c("error", "omit"),
facets = NULL, nesting = NULL, score = NULL, weights = NULL,
d_study_grid = NULL, truncate_negative = TRUE)
Arguments
data |
A |
scores |
Character vector naming one or more score columns. |
person |
Character string naming the person identifier column. |
rater |
Character string naming the rater column when |
task |
Character string naming the task column when |
method |
Variance-component estimator ( |
missing |
Missing-value policy ( |
facets |
Character vector of non-person facet column names. |
nesting |
Optional named character vector |
score |
Alias for |
weights |
Optional nonnegative composite weights matching |
d_study_grid |
Optional candidate D-Study design grid |
truncate_negative |
Logical; whether to clamp negative variance estimates at zero. |
Details
Henderson Method 1 solves the expected mean-product equations for the declared
crossed or nested random-effects design. A rank-deficient coefficient matrix is
rejected: the data cannot distinguish the requested variance components.
For urgenova, unidentified components and too few complete observations
signal an error of class "mfrm_gstudy_unavailable".
Negative raw estimates are retained in RawEstimate; truncate_negative
controls their use in projected point estimates.
For urgenova, zero total variance or negative universe/projected error
variance gives an unavailable G/Phi (NA), with the reason in
GStatus/PhiStatus; see mfrm_d_study.
The urgenova sampling covariance uses the Gaussian quadratic-form identity
\operatorname{Cov}(y'Ay,y'By)=2\operatorname{tr}(AVBV) with the actual
assignment pattern, including imbalance and replication. The working covariance
V substitutes nonnegative component estimates (negative raw estimates are
zeroed for this calculation). This is a plug-in covariance, not an exact
finite-sample distribution or a model-free uncertainty estimate.
confint() uses Satterthwaite chi-square approximations for positive
components and logit delta intervals for G/Phi; boundary coefficients may have
unavailable intervals (NA). The approximation is particularly limited
near zero components and in sparse designs. As a conservative reporting guard,
positive components with Satterthwaite degrees of freedom below 1 have both
endpoints set to NA. This cutoff is not a coverage guarantee for other
components. The named status attribute of the interval matrix records
unstable_satterthwaite_df, the approximation used, or numerical
unavailability. tidy(gt) and workflow reports carry these statuses and
95% component intervals. MLS intervals for the balanced ANOVA representation
use different mean-product information and are not substituted for this
unbalanced Henderson approximation.
Value
An mfrm_gtheory object for every estimator, with method_code,
design, raw score covariance matrices in components, composite
variance_components, g_study_summary, and a d_study table.
Method-specific numerical ingredients and unavailable summaries are recorded
explicitly. Incomplete ANOVA/MINQUE designs require a future design_grid;
observed pool sizes are not silently interpreted as planned replication.
Use summary(g)$component_diagnostics to inspect covariance definiteness.
For Henderson, vc_vcov describes the supplied composite. For ANOVA/MINQUE,
vcov(g, score = ..., assumption = "normal") selects score or composite
sampling uncertainty. Balanced ANOVA supports confint(g, method = "mls",
assumption = "normal"); this interval construction is not applied to unbalanced
Henderson estimates. tidy(g) reports covariance entries for ANOVA/MINQUE;
Henderson's composite table additionally includes interval status.
Examples
ratings <- load_mfrmr_data("example_core")
gt <- mfrm_g_study(ratings, scores = "Score", person = "Person",
facets = c("Rater", "Criterion"), method = "urgenova")
mfrm_d_study(gt)
Initialize a Pipeable Many-Facet Assessment Workflow
Description
Creates a tidymfrm workflow specification and immediately executes a fast
C++ graph connectivity and category-support audit via
mfrmr::check_mfrm_connectivity(). Pipe into step_mfrm_measure(),
step_mfrm_gtheory(), step_mfrm_diagnose(), and render_mfrm_report(),
or run everything in one call with mfrm_analysis().
Usage
mfrm_workflow(
data,
person,
facets,
score,
rater_facet = NULL,
occasion = NULL,
rating_min = NULL,
rating_max = NULL,
fit = NULL,
expected_design = NULL,
rater_panels = NULL
)
Arguments
data |
A |
person |
Character string naming the person identifier column. |
facets |
Character vector of non-person facet column names (e.g., |
score |
Character string naming the numeric rating column. |
rater_facet |
Optional character string naming the rater facet; inferred automatically if |
occasion |
Optional character string naming the rating occasion/wave column for Markov rater drift modeling. |
rating_min, rating_max |
Optional integer rubric bounds. |
fit |
Optional |
rater_panels |
Optional named character vector assigning rater IDs to panels for effective resistance. |
expected_design |
Optional score-free roster of planned rating cells. |
Value
A tidymfrm workflow object.
Examples
utils::data("mfrmr_example_core", package = "mfrmr")
wf0 <- mfrm_workflow(mfrmr_example_core, "Person", c("Rater", "Criterion"), "Score")
wf0$connectivity$connected
Standard S3 Extractor, Prediction, Inference, and Comparison Methods for mfrmr Objects
Description
Standard R S3 methods (predict, coef, vcov, confint, anova, fitted, residuals, logLik, AIC, BIC, nobs, summary, print, and as.data.frame) for objects returned by mfrmr. In particular, predict() evaluates expected scores, category probability matrices, linear predictors, Fair(M), or new-examinee WLE scores under arbitrary user-supplied newdata conditions.
Usage
## S3 method for class 'mfrm_fit'
predict(object, newdata = NULL,
type = c("response", "probs", "prob", "link", "fair", "wle", "eap"),
person_data = NULL, facet_data = NULL, se.fit = FALSE, ...)
## S3 method for class 'mfrm_fit'
coef(object,
type = c("all", "facets", "locations", "steps", "slopes", "person", "persons",
"explanatory", "interactions", "population", "free"), ...)
## S3 method for class 'mfrm_fit'
vcov(object,
component = c("design", "facets", "steps", "slopes", "explanatory", "population"),
se_type = c("model", "sandwich"), facet = NULL, ...)
## S3 method for class 'mfrm_fit'
confint(object, parm = NULL, level = 0.95,
component = c("facets", "steps", "slopes", "person", "explanatory",
"interactions", "population", "free"),
se_type = c("model", "real", "sandwich", "profile"), ...)
## S3 method for class 'mfrm_fit'
anova(object, ..., nested = TRUE)
## S3 method for class 'mfrm_gtheory'
confint(object, parm = NULL, level = 0.95, ...)
Arguments
nested |
Logical; request nested-model likelihood-ratio inference after eligibility checks. |
object |
A fitted measurement model or G-Study object. |
newdata |
Rating conditions containing the fitted base facet columns.
An explicit numeric |
type |
For prediction: |
person_data, facet_data |
Optional covariate tables for unseen persons or explanatory facet levels, using the fitted model's column definitions. |
se.fit |
For |
component |
Parameter block. |
se_type |
|
facet |
Optional facet name for covariance extraction. |
parm |
Optional parameter names or indices selecting interval rows. |
level |
Confidence level in |
... |
Additional fitted models for |
Details
Prediction uncertainty. Response/link SEs use the full covariance of
free structural coordinates, including cross-facet covariances, estimated steps,
interactions, explanatory coefficients, and GPCM log-slopes as applicable.
Ability is held fixed at the supplied or plug-in value: person-score uncertainty,
uncertainty in a predicted population mean, and future rating variance are excluded.
These are SEs of conditional model predictions, not prediction intervals for
individual ratings. An unusable calibration gives NA SEs.
"link" is the unscaled predictor; its gradient excludes steps and slopes.
Measurement-model intervals. Model and sandwich intervals are local
normal approximations; slope intervals are formed on log-slopes then exponentiated.
For primary EAP scores the person SE is posterior SD conditional on calibration,
so the normal interval is an approximate conditional posterior summary, not a
calibration-inclusive frequentist confidence interval. Fit-inflated "real"
intervals are descriptive. Numerically ineligible calibrations are rejected.
For WLE, person intervals use conditional score uncertainty with calibration
parameters treated as estimated constants. They do not propagate calibration
uncertainty. MML sandwich SEs cluster scores by person; they still require
independent persons and enough informative clusters for the target parameter.
A large total number of ratings does not compensate for a facet level observed
on very few persons. Sandwich SEs do not repair biased point estimates or
guarantee small-sample coverage. Inspect interval availability separately from
the coverage properties established for the intended model and assignment.
Nested likelihood comparisons. anova() requires the same retained
responses, person/facet assignments, weights, category support and numerical
integration settings, unpenalized MML or CML, converged eligible fits, and nested
identified parameter spaces. It rejects materially decreasing optimized
likelihoods instead of reporting a zero statistic. A failed check leaves
lrt = NULL and an unavailable comparison_basis$lrt_status.
The chi-square reference remains an asymptotic regular-interior approximation;
passing computational checks does not guarantee small-sample calibration.
G-Study covariance and interval assumptions are described in
mfrm_g_study.
Value
Standard S3 return values: numeric vectors or matrices for predict, coef, vcov, confint, fitted, and residuals; logLik / scalar criteria for logLik, AIC, BIC, and nobs; mfrm_comparison tables for anova; and structured summaries for summary and print.
Examples
ratings <- load_mfrmr_data("example_core")
fit_rsm <- fit_mfrm(ratings, "Person", c("Rater", "Criterion"), "Score", model = "RSM")
fit_pcm <- fit_mfrm(ratings, "Person", c("Rater", "Criterion"), "Score",
model = "PCM", step_facet = "Criterion")
coef(fit_rsm, type = "facets")
confint(fit_rsm, component = "facets", se_type = "real")
vcov(fit_rsm, facet = "Rater")
predict(fit_rsm, newdata = data.frame(theta = 0, Rater = "R01", Criterion = "Content"))
anova(fit_rsm, fit_pcm)
Synthetic ratings illustrating agreement, offsets and missing scores
Description
Ready-to-load data from the rating-agreement tutorial. Six Persons complete
two Tasks, with up to three Raters on each response. Load with
data("mfrmr_example_agreement", package = "mfrmr").
Format
A data frame with 35 rows and four columns:
Person, Task, Rater, and Score. Each row is one rater's rating of
one Person's response to one Task. Scores use the declared categories 0–3.
Details
Rater R2 always scores one category above R1, so their rankings agree but
their scores differ. R3 has two deliberately different scores, one missing
score (P06/T2) and one absent row (P02/T2). There are 34 observed scores.
Missing ratings are not zero scores; an absent row alone does not identify
whether a rating was planned. Use unit = c("Person", "Task") to match
responses. unit = "Person" would mix two different responses.
These are constructed teaching data, not empirical records, expert standards or evidence of a method's performance in a population.
Source
Existing data from the rating-agreement tutorial. The deterministic
construction is retained in data-raw/make-teaching-data.R in the source
repository.
See Also
interrater_agreement(),
load_mfrmr_data()
Examples
data("mfrmr_example_agreement", package = "mfrmr")
ratings <- mfrmr_example_agreement
head(ratings)
with(ratings, table(Rater, Score, useNA = "ifany"))
agreement <- interrater_agreement(ratings, rater = "Rater",
unit = c("Person", "Task"), score = "Score", categories = 0:3)
agreement$table
# Each pair uses its own shared responses; inspect its denominator as well.
Synthetic many-facet rating examples
Description
Compact synthetic many-facet datasets sized to exercise the documented workflow. Their dimensions are not evidence of sample-size adequacy for an applied study.
Format
A data.frame with 6 columns:
- Study
Example dataset label (
"OperationalExample","ExampleCore", or"ExampleBias").- Person
Person/respondent identifier.
- Rater
Rater identifier.
- Criterion
Criterion facet label.
- Score
Observed category score on a four-category scale (
1–4).- Group
Balanced grouping label (
"A"/"B"). It is neutral in the operational and core examples; the bias example has the planted group structure described below.
Details
Available data objects:
-
mfrmr_example_operational -
mfrmr_example_operational_design(documented separately below) -
mfrmr_example_core -
mfrmr_example_bias
mfrmr_example_operational is the primary applied teaching example. It has
a connected but incomplete two-rater assignment, moderately unequal rater
workloads, and six planned criterion-level omissions. Scores are sampled
directly from stated RSM category probabilities. The six unobserved ratings
are absent rows in the long data rather than NA scores. Each group contains
24 persons, and three omissions in each group leave 141 observed rows for
Group A and 141 for Group B. The balanced Group variable has no effect in
the generating model; random observed differences may still occur.
mfrmr_example_core is an idealized complete crossing generated from a
single latent trait plus rater and criterion main effects. It is useful as a
fast deterministic example, but it is not representative of routine
incomplete operational assignment.
mfrmr_example_bias instead uses a balanced partial two-rater assignment.
Group A and B latent means are -0.1 and 0.1 logits, respectively, with a
common SD of 0.9. It also contains:
a planted
Group x Criterioneffect (Group Bis advantaged by 1.2 logits onLanguage)a planted
Rater x Criterioninteraction (R04 x Accuracylowers the linear predictor by 1.2 logits)
This lets differential-functioning and bias-analysis help pages demonstrate non-null findings.
Data dimensions
| Dataset | Rows | Persons | Raters | Criteria | Groups |
| example_operational | 282 | 48 | 6 | 3 | 2 |
| example_core | 768 | 48 | 4 | 4 | 2 |
| example_bias | 384 | 48 | 4 | 4 | 2 |
Suggested usage
Use
mfrmr_example_operationalfor the beginner data-to-report workflow and for inspecting incomplete but connected assignment.Use
mfrmr_example_corefor fast, idealized checks and examples that specifically require complete crossing.Use
mfrmr_example_biasforanalyze_dff(),plot(x, type = "pathway"), andestimate_bias().
All three objects can be loaded either with load_mfrmr_data() or directly
with data(), for example
data("mfrmr_example_operational", package = "mfrmr").
Source
Synthetic documentation data generated from rating-scale Rasch facet
designs with fixed seeds. Generator scripts are maintained under
data-raw/ for this release in the public source repository.
These are synthetic examples, not empirical records.
Examples
data("mfrmr_example_operational", package = "mfrmr")
table(mfrmr_example_operational$Score)
table(mfrmr_example_operational$Group)
Planned assignment roster for the operational example
Description
A score-free roster declaring all Person x Rater x Criterion cells planned
for mfrmr_example_operational. Pass it to the expected_design argument of
describe_mfrm_data() to distinguish the six expected-but-unobserved cells
from combinations that were never assigned.
Format
A data.frame with 288 rows and 5 columns:
- Study
Example dataset label (
"OperationalExample").- Person
Person/respondent identifier.
- Rater
Planned rater identifier.
- Criterion
Planned criterion label.
- Group
Balanced grouping label (
"A"/"B").
Details
The roster contains 288 planned cells. The observed
mfrmr_example_operational table contains 282 rows, so an explicit design
comparison identifies six planned omissions. Extra roster columns such as
Study and Group are ignored unless they are named as model facets.
Source
Synthetic assignment roster generated with the operational example
by data-raw/make-operational-example.R. It contains no empirical records
and no fabricated scores.
Examples
data("mfrmr_example_operational", package = "mfrmr")
data("mfrmr_example_operational_design", package = "mfrmr")
review <- describe_mfrm_data(
mfrmr_example_operational,
person = "Person",
facets = c("Rater", "Criterion"),
score = "Score",
expected_design = mfrmr_example_operational_design
)
summary(review)$structural_missingness
Synthetic crossed and nested data for learning G theory
Description
Existing tutorial examples supplied as ready-to-load tables. Load one with
data("mfrmr_example_gtheory_crossed", package = "mfrmr"), then assign it
to a shorter name such as ratings. No simulation code is needed to run
the G-study or D-study examples.
Format
Two data frames with five columns: Person, Rater, Task,
Content, and Organization. Each row is one Person-by-Rater-by-Task
rating cell; the last two columns are continuous numeric scores.
mfrmr_example_gtheory_crossed has 1,920 rows (40 Persons, eight common
raters and six common tasks). mfrmr_example_gtheory_nested has 540 rows
(30 Persons, six tasks and three raters per task).
Details
In the crossed example, the same rater ID denotes the same rater on every
task. In the nested example, R1, R2, R3 are local labels: the pair
Task and Rater identifies a rater, giving 18 raters in total. Declare
nesting = c(Rater = "Task") for that example. Persons are crossed with
all tasks and rater teams in both examples.
The scores were constructed from independent normal random effects for every source in the respective design. The nested example correlates the two score components within each source. These are fictional unbounded continuous scores, not ordered rubric categories or MFRM ability estimates. Their design and sample sizes demonstrate the functions; they do not establish that an assessment's assumptions or estimation precision are adequate.
Source
The existing crossed G-theory tutorial (seed 24) and nested
G-study help example (seed 2027). Their unchanged generation recipes are
retained in data-raw/make-teaching-data.R in the source repository.
See Also
mfrm_g_study(), mfrm_d_study(),
load_mfrmr_data()
Examples
data("mfrmr_example_gtheory_crossed", package = "mfrmr")
ratings <- mfrmr_example_gtheory_crossed
head(ratings)
g <- mfrm_g_study(ratings, scores = c("Content", "Organization"),
person = "Person", rater = "Rater", task = "Task")
g$component_diagnostics
# Inspect component estimates before projecting future plans.
d <- mfrm_d_study(g,
design_grid = data.frame(Raters = c(2, 4), Tasks = 3),
weights = c(Content = .5, Organization = .5))
summary(d)
Color-Vision-Safe ggplot2 Visualizations for Many-Facet Models and Diagnostics
Description
Unified ggplot2 plot() methods for fitted MFRM models, diagnostics, G/D-Studies, pairwise RajuSA-Welch bias tables, DFF screens, test information curves, and rater drift trajectories. Every multi-group aesthetic pairs color ("okabe_ito", "viridis", or strict R == G == B "monochrome") with distinct point shape and linetype encodings. Canvas titles and footnotes are omitted by default and stored in attr(p, "mfrm_notes").
Usage
## S3 method for class 'mfrm_bias'
plot(
x, type = c("forest", "pairwise"), top_n = 20L,
palette = c("okabe_ito", "viridis", "monochrome"), base_size = 11, ...)
## S3 method for class 'mfrm_diagnostics'
plot(
x, facet = NULL, palette = c("okabe_ito", "viridis", "monochrome"),
base_size = 11, ..., type = c("pathway", "residual_pca"))
## S3 method for class 'mfrm_dff'
plot(
x, top_n = 25L, palette = c("okabe_ito", "viridis", "monochrome"),
base_size = 11, ...)
## S3 method for class 'mfrm_drift'
plot(
x, type = c("trajectory", "contrasts"),
palette = c("okabe_ito", "viridis", "monochrome"), base_size = 11, ...)
## S3 method for class 'mfrm_fit'
plot(
x,
type = c("wright", "pathway", "steps", "category_curves", "persons",
"raters", "person_fit", "residual_qq", "slopes", "qc"),
palette = c("okabe_ito", "viridis", "monochrome"), facet = NULL,
base_size = 11, ..., fit_statistic = c("infit", "outfit", "both"))
## S3 method for class 'mfrm_gtheory'
plot(
x, type = NULL,
palette = c("okabe_ito", "viridis", "monochrome"), base_size = 11, ...)
## S3 method for class 'mfrm_information'
plot(
x, type = c("information", "ccc"),
palette = c("okabe_ito", "viridis", "monochrome"), base_size = 11, ...)
## S3 method for class 'mfrm_multivariate_d_study'
plot(
x, palette = c("okabe_ito", "viridis", "monochrome"), base_size = 11, ...)
Arguments
fit_statistic |
Horizontal mean-square statistic for a pathway plot. Use |
x |
An mfrmr model, diagnostic, bias, DFF, information, drift, G/D-Study object. |
type |
Character string selecting the visualization panel: for diagnostic objects, |
top_n |
Maximum number of ranked bias cells or DFF elements to display. |
palette |
Color-vision-safe palette: |
base_size |
Base font size in points (default |
... |
Additional plotting options. |
facet |
Optional facet name filter for element pathway and rater diagnostic plots. |
Details
The "person_fit" panel plots Outfit against the reported person-fit
index from compute_person_fit_indices(): conditional l_z^*
when available, otherwise l_z. Its two-sided flags agree with
summary() of that result. These are screening references, not
calibrated significance tests.
For unified-engine fits, slope bars use the same log-scale 95 percent model
intervals as confint(x, component = "slopes"). Person and facet diagnostic
bars use descriptive Real-SE intervals. When the calibration fails inference
readiness, these interval bars are withheld while finite descriptive points are
retained; attr(p, "mfrm_notes") records the reasons. Neither visible bars
nor a ready status establish nominal finite-sample coverage.
Value
A ggplot object with diagnostic and scale notes attached in attr(p, "mfrm_notes").
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
fit <- saved$fit
p1 <- plot(fit, type = "wright", palette = "okabe_ito")
p2 <- plot(fit, type = "category_curves", palette = "viridis")
p3 <- plot(fit, type = "residual_qq", palette = "monochrome")
attr(p1, "mfrm_notes")
Plot End-to-End Many-Facet Measurement, Generalizability, and Rater Diagnostics
Description
Produces clean, publication-ready, color-vision-safe ggplot2 figures from a
mfrm_analysis() workflow object. Every multi-group aesthetic pairs colour
("okabe_ito", "viridis", or "monochrome") with distinct point shape
and linetype encodings. By default, plot titles and footnotes are omitted
from the canvas and stored in attr(p, "mfrm_notes").
Usage
## S3 method for class 'tidymfrm'
plot(
x,
type = c("wright", "raters", "steps", "category_curves", "dstudy", "persons",
"person_fit", "residual_qq", "slopes", "drift", "qc", "dashboard", "dstudy_frontier",
"gstudy", "pathway"),
palette = c("okabe_ito", "viridis", "monochrome"),
base_size = 11,
draw = TRUE,
...,
newdata = NULL
)
Arguments
x |
A |
type |
Plot type:
|
palette |
Color palette: |
base_size |
Base font size in pts (default |
draw |
Logical; if |
... |
Additional arguments passed to underlying |
newdata |
For |
Value
A ggplot object (with attr(, "mfrm_notes")), or for type = "dashboard",
a tidymfrm_dashboard named list of four ggplot panels.
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
ratings <- load_mfrmr_data(saved$dataset)
wf <- mfrm_workflow(ratings, "Person", c("Rater", "Criterion"), "Score",
fit = saved$fit) |>
step_mfrm_diagnose()
p_wright <- plot(wf, type = "wright", palette = "okabe_ito", draw = FALSE)
p_vir <- plot(wf, type = "raters", palette = "viridis", draw = FALSE)
p_mono <- plot(wf, type = "steps", palette = "monochrome", draw = FALSE)
attr(p_wright, "mfrm_notes")
Render Reproducible APA-Style & Individual Rater Feedback Reports
Description
Generates a structured Markdown, standalone HTML, or Word (docx) report
synthesizing multi-facet connectivity, Many-Facet Rasch and Generalized Partial
Credit Measurement (RSM/PCM/GPCM and optional Markov rater drift),
observed-score Generalizability and Decision Studies (G-Study/D-Study),
rater diagnostics (Fair(M), ModelSE vs RealSE, Infit/Outfit),
optional RajuSA-Welch pairwise bias, DFF, and cut-score sensitivity tables,
and individual rater calibration feedback cards.
The opening summary shows calibration readiness, D-Study plans at equal
rating counts and the availability of rater screening. In the unexpected
ratings table, InputRow is the one-based row of the supplied data frame.
Usage
render_mfrm_report(
x,
format = c("markdown", "html", "docx"),
file = NULL,
title = "Many-Facet Measurement, Generalizability, and Rater Audit Report",
include_rater_cards = TRUE,
max_unexpected = 10L,
digits = 3L,
rater = NULL,
criterion_facet = NULL,
reference_plan = NULL,
fair_level = 0.95
)
Arguments
x |
A |
format |
Output format: |
file |
Optional file path (use |
title |
Report heading string. |
include_rater_cards |
Logical; if |
max_unexpected |
Maximum number of unexpected rating rows ( |
rater |
Optional rater ID. Produce a focused feedback report for this rater. |
criterion_facet |
Optional non-rater facet identifying criteria for within-criterion residual/expected-score correlations and matched residual associations. These descriptive correlations do not by themselves diagnose central tendency or halo. The residual-correlation null baseline depends on the fitted model and rating design; neither zero nor a fixed negative correction is a calibrated cutoff. |
reference_plan |
Optional common rating plan for original-scale person Fair Average intervals in the assessment report. See |
fair_level |
Level of the conditional normal approximation for common-plan scores. |
digits |
Rounding digits for formatted numeric tables (default |
Details
The assessment report includes estimator and scoring settings, agreement and its
conditional model expectation, reliability and homogeneity screens, anchor
displacement, observed design connectivity and available multivariate G-Study
results. The homogeneity test uses diagonal ModelSE variances and is a screen.
Group displacement is a conditional one-step common location shift with other
measures fixed. The method notes describe the assumptions for each result.
summary(wf, reference_plan = ..., fair_level = ...) exposes the metadata
and these tables for programmatic use.
A focused rater report describes severity rank in a connected panel, rubric scores, fit, compression of scores toward the middle, matched criterion residual correlations and the largest unexpected ratings. The last two statistics use the matched contexts stated by the report. Residual correlations are withheld when the corresponding observed scores do not vary. Review the source rating records before interpreting a screening result.
Value
Character string containing the formatted Markdown/HTML report, or
the output .docx file path (invisibly when file is supplied).
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
ratings <- load_mfrmr_data(saved$dataset)
wf <- mfrm_workflow(ratings, "Person", c("Rater", "Criterion"), "Score",
fit = saved$fit) |>
step_mfrm_diagnose()
md <- render_mfrm_report(wf, format = "markdown")
tmp_html <- tempfile(tmpdir = tempdir(), fileext = ".html")
render_mfrm_report(wf, format = "html", file = tmp_html)
unlink(tmp_html)
Step 3: Diagnose Raters, Fair(M), Real SE, Bias (RajuSA-Welch), and DFF
Description
Computes rater diagnostic flags (Infit/Outfit MnSq and ZSTD, Fair(M),
ModelSE vs RealSE), extracts unexpected rating cells (|StdResidual| >= 2.0),
estimates RajuSA-Welch pairwise bias, and optionally screens group-level DFF
and cut-score classification sensitivity.
Usage
step_mfrm_diagnose(
wf,
mnsq_range = c(0.7, 1.3),
zstd_limit = 2,
bias_df_method = c("facets", "classical"),
dff_group = NULL,
dff_method = c("mml_lrt", "cml_lrt", "raju_welch", "mh", "logistic"),
cut_scores = NULL,
threads = 1L
)
Arguments
wf |
A |
mnsq_range |
Acceptable |
zstd_limit |
Absolute |
bias_df_method |
Degrees-of-freedom convention for 2-way pairwise bias
screening: |
dff_group |
Optional person-group column name in |
dff_method |
DFF estimator when |
cut_scores |
Optional finite numeric |
threads |
Number of C++ worker threads for split-rater DFF refits (default |
Details
Rater screens and intervals are withheld when calibration is not
numerically ready; Review required is distinct from Acceptable.
Cutoff sensitivity uses a normal approximation conditional on the fitted
calibration, not a confidence statement about true pass status. It does not
include calibration uncertainty or guarantee coverage under misspecification.
Available_ModelSE/Available_RealSE count persons contributing to each
borderline count. A wholly unavailable count is NA, not zero. Cutoffs at
or outside a person's attainable open Fair(M) range have no finite logit
inverse. PassCount and PassRatePct remain descriptive, with denominator
PassAvailable. See mfrmr::analyze_dff() for refit restrictions.
Value
Updated tidymfrm workflow object with $diagnostics.
Examples
utils::data("mfrmr_example_core", package = "mfrmr")
wf <- mfrm_workflow(mfrmr_example_core, "Person", c("Rater", "Criterion"), "Score") |>
step_mfrm_measure(model = "RSM", method = "MML") |>
step_mfrm_diagnose(cut_scores = c(2.5, 3.0))
tidy(wf, component = "raters")
Step 2: Run Generalizability (G-Study) and Decision (D-Study) Planning
Description
Decomposes observed rating variance via C++ urGENOVA (supporting crossed,
nested nesting, and multivariate composite g_scores / g_weights designs)
and evaluates candidate D-Study designs against target_g and target_phi.
Usage
step_mfrm_gtheory(
wf,
g_facets = NULL,
nesting = NULL,
g_scores = NULL,
g_weights = NULL,
d_study_grid = NULL,
target_g = 0.8,
target_phi = 0.8,
g_data = NULL
)
Arguments
wf |
A |
g_facets |
Optional facet vector for G-Study (defaults to all facets in |
nesting |
Optional named character vector |
g_scores |
Optional character vector of score columns for multivariate G-Study. |
g_weights |
Optional nonnegative composite weights matching |
d_study_grid |
Optional candidate design grid |
target_g |
Target generalizability coefficient |
g_data |
Optional separate table on which to fit the G-Study. Reported G-Study row counts refer to this input when supplied. |
target_phi |
Target dependability index |
Details
A connected rating design can support calibration while failing to
identify separate G-Study variance components. Keep the calibrated workflow
in a named object before running this step. If planning fails, use that
object with step_mfrm_diagnose() and render_mfrm_report() to review the
ratings while you check the assignment and nesting assumptions.
The G-Study uses rows complete for its selected identifiers and scores.
The report gives the number of rows included and omitted.
Value
Updated tidymfrm workflow object with $gtheory.
Examples
utils::data("mfrmr_example_core", package = "mfrmr")
wf <- mfrm_workflow(mfrmr_example_core, "Person", c("Rater", "Criterion"), "Score") |>
step_mfrm_gtheory(target_g = 0.80, target_phi = 0.75)
tidy(wf, component = "g_study")
Step 1: Estimate Many-Facet Rasch or Generalized Partial Credit Model
Description
Fits RSM, PCM, or a Generalized Many-Facet Rasch Model
(GMFRM, selected with model = "GPCM") via fit_mfrm on the C++
engine, with optional dynamic Markov rater drift (occasion), multi-method
sensitivity comparison (compare_methods), and parametric bootstrap (bootstrap).
Re-estimation clears the previous calibration's diagnostics and comparisons.
Run step_mfrm_diagnose() again to attach diagnostics for the new calibration.
Usage
step_mfrm_measure(
wf,
model = c("RSM", "PCM", "GPCM"),
method = c("MML", "JML", "JML_jeffreys", "CML"),
step_facet = NULL,
slope_facet = NULL,
slope_reference = NULL,
slope_type = c("full_predictor", "ability_only"),
slope_prior_sd = NULL,
occasion = NULL,
person_score = c("auto", "EAP", "WLE"),
compare_methods = NULL,
population_formula = NULL,
person_data = NULL,
step_constraints = NULL,
category_support = NULL,
facet_formulas = NULL,
facet_data = NULL,
quad_points = 31L,
mml_integration = c("fixed", "adaptive"),
xtreme = 0.3,
warn_connectivity = TRUE,
bootstrap = 0L,
threads = 1L,
gpcm_mml_identification = NULL
)
Arguments
wf |
A |
model |
|
method |
Primary estimation method: |
step_facet |
Facet owning category thresholds when |
slope_facet |
Facet(s) owning discrimination slopes when |
slope_reference |
Reference slope facet constrained to geometric mean 1 when two facets have discrimination parameters. |
slope_type |
GPCM parameterization: |
slope_prior_sd |
Optional log-normal prior SD regularizing GPCM log-slopes. |
occasion |
Optional rating occasion/wave column name to run dynamic Markov rater drift modeling. |
person_score |
|
compare_methods |
Optional character vector of additional estimators
(e.g., |
population_formula |
Optional latent-regression formula for |
person_data |
Optional person-level covariate table. |
step_constraints |
Optional step-constraint declarations ( |
category_support |
Optional per-level category support bounds ( |
facet_formulas, facet_data |
Optional explanatory facet covariate formulas and data. |
quad_points |
Quadrature points for |
mml_integration |
|
xtreme |
Extreme-score adjustment for |
warn_connectivity |
Logical; if |
bootstrap |
Number of conditional parametric bootstrap replications
( |
threads |
Number of C++ worker threads for |
gpcm_mml_identification |
Optional scale identification for GPCM MML.
Use |
Value
Updated tidymfrm workflow object with $fit (and optional $drift, $method_comparison, and $bootstrap).
Examples
utils::data("mfrmr_example_core", package = "mfrmr")
wf <- mfrm_workflow(mfrmr_example_core, "Person", c("Rater", "Criterion"), "Score") |>
step_mfrm_measure(model = "GPCM", method = "MML", slope_facet = "Rater")
tidy(wf, component = "slopes")
Tidy a Many-Facet Model or Workflow Object
Description
Extracts tidy tibble summaries of parameters, rater diagnostics, persons,
thresholds, GPCM discrimination slopes, dynamic rater drift, or generalizability studies.
Usage
tidy(x, ...)
## S3 method for class 'tidymfrm'
tidy(
x,
component = c("raters", "facets", "persons", "steps", "slopes", "g_study", "d_study",
"dff", "drift"),
conf.level = 0.95,
use_real_se = TRUE,
...
)
## S3 method for class 'mfrm_fit'
tidy(
x,
component = c("facets", "persons", "steps", "slopes"),
conf.level = 0.95,
use_real_se = TRUE,
...
)
## S3 method for class 'mfrm_gtheory'
tidy(x, component = c("g_study", "d_study"), conf.level = 0.95, ...)
Arguments
x |
A |
... |
Additional arguments (unused). |
component |
Component to extract: |
conf.level |
Confidence level for Wald intervals (default |
use_real_se |
Logical; if |
Details
Intervals use the public mfrmr::confint() contract, including
exponentiated log-slope intervals for GPCM. When calibration is not ready,
interval endpoints are NA; inference_status and inference_reason
explain why. Point estimates and SE columns remain descriptive outputs.
G-Study tables include conf.low, conf.high, and
interval_status; see mfrm_g_study for the approximation
and the reporting guard for degrees of freedom below one.
Value
Examples
# Saved JML calibration of example_core; see fit_mfrm() for estimation.
saved <- readRDS(system.file("examples", "core-jml.rds", package = "mfrmr"))
ratings <- load_mfrmr_data(saved$dataset)
wf <- mfrm_workflow(ratings, "Person", c("Rater", "Criterion"), "Score",
fit = saved$fit) |>
step_mfrm_diagnose()
tidy(wf, component = "raters")
glance(wf)
head(augment(wf))
Standard S3 Methods for tidymfrm Workflow Objects
Description
Standard S3 methods (anova, predict, coef, vcov, confint,
summary, and print) for tidymfrm workflow objects.
Usage
## S3 method for class 'tidymfrm'
anova(object, ...)
Arguments
object |
A calibrated |
... |
For |
Details
anova() compares separately fitted models using the underlying
mfrmr likelihood and nesting checks. Compare fits with the same retained
ratings, weights, likelihood method, population and integration settings.
Inspect comparison_basis when lrt is unavailable. Information
criteria are interpretable as differences only for comparable likelihoods.
compare_methods in step_mfrm_measure() addresses sensitivity to
the estimator within a specified model.
Value
Standard S3 return values delegated from the underlying fitted mfrmr
model or workflow summary.
Examples
utils::data("mfrmr_example_core", package = "mfrmr")
wf <- mfrm_workflow(mfrmr_example_core, "Person", c("Rater", "Criterion"), "Score") |>
step_mfrm_measure()
coef(wf)
confint(wf)
head(predict(wf, type = "response"))