| grass_report | R Documentation |
grass_report() is the package's headline entry point. It takes an N x k binary rating matrix and returns a
four-field Report Card: the sample summary (k, N, pi_hat), the primary
coefficient and its surface position, the cross-coefficient asymmetry
diagnostic delta_hat and flag, and (when flag == "divergent") the
per-rater latent-class fit. The full panel of coefficients, pooled
percentiles, consistency bands on quality, and reference-surface
artifacts ride along on the same object for summary(),
as.data.frame(), and plot() access.
grass_report(
ratings,
axis = c("inter", "intra"),
metric = "auto",
bootstrap_B = 1000L,
bootstrap_delta_B = 0L,
verbose = FALSE,
...
)
ratings |
User input: an |
axis |
One of |
metric |
One of |
bootstrap_B |
Integer; bootstrap replicates for the divergent-branch
latent-class CIs. Default |
bootstrap_delta_B |
Integer; subject-resampling replicates for the
optional bootstrap distribution of |
verbose |
Logical; emit progress messages on long calls. Default
|
... |
Passed to |
The body, in order:
Normalize ratings to a canonical N x k integer matrix Y and
derive pi_hat = mean(Y), k = ncol(Y), N = nrow(Y). Validate
k >= 2; warn at N < 10; note at N < 30.
Compute the panel of observed coefficients
(compute_panel(), internal): at k = 2, PABAK / AC1; at
k >= 3, PABAK / AC1 / Fleiss kappa / ICC. Cohen's kappa is not on
the card at any k; it has no calibrated reference.
For each panel coefficient, position the observed value on its
DGP-calibrated reference surface via position_on_surface().
Pick the primary coefficient by prevalence (metric = "auto") or accept
the user's override.
Compute the cross-coefficient implied-quality spread delta_hat
(in pp of quality) via check_asymmetry() and flag aligned /
caution / divergent by delta_hat's percentile on the matched
(k, N, q_hat) null.
If flag == "divergent": run a latent_class_fit() (Dawid-Skene EM
at k >= 3; Hui-Walter bounds at k = 2) and attach the per-rater
(Se_j, Sp_j) table.
Assemble the grass_card S3 object.
An object of class c("grass_card", "list") with fields
sample, coefficient, delta, panel, per_rater, surface,
call, grass_version, timestamp, inputs, notes.
coefficient carries the primary coefficient's observed_value,
its surface_percentile (the pooled percentile – position within the
design's achievable agreement range – on the 0-100 scale), the
implied panel quality q_hat, and the 95% test-inversion
consistency_band on quality (suppressed at the divergent flag).
panel is a data.frame with one row per coefficient carrying its
observed_value, surface_percentile, consistency-band columns
(band_lo, band_hi, band_open_low, band_open_high), q_hat,
se_q_hat, clamped, reference_used, and in_delta_hat.
delta carries delta_hat (implied-quality spread, in pp of
quality), delta_percentile (its percentile on the matched null),
flag, matched_null, thresholds, and thresholds_source.
Percentile units. card$coefficient$surface_percentile and
card$panel$surface_percentile are reported on the 0-100 scale
(e.g., 46.3 means the 46th percentile). The underlying
position_on_surface() returns percentile on the 0-1 fraction
scale; grass_report() multiplies by 100 to match the paper's
prose convention. The print and format methods use ordinal
notation ("46th percentile").
# k >= 3 computes ICC via a glmer fit when lme4 (Suggests) is
# available; without lme4 the card degrades gracefully to the
# agreement family.
set.seed(1)
Y <- matrix(rbinom(1000, 1, 0.3), nrow = 200, ncol = 5)
card <- grass_report(ratings = Y)
card # print
summary(card) # full panel + per-rater
as.data.frame(card) # tidy long-format
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.