Estimates Fleiss and Brennan-Prediger weighted agreement coefficients for counts-format data: each row is one subject; each column is a category; `x[i, k]` is the number of raters who assigned subject `i` to category `k`. Row sums (number of raters per subject) need not be uniform across subjects.
The count-format moment estimator follows the Fleiss-Cuzick unequal-judges convention: observed row disagreement is weighted by `r_i - 1`, and chance disagreement uses the pooled rating-token margin. This differs from the unit-weighted distribution/count convention used by some software; the unit-weighted comparator is kept only in the C++ API for validation studies.
Rows with fewer than two observed ratings contain no within-subject pair information and receive zero observed-disagreement weight; at least one row with two or more ratings is required.
Counts data assumes **exchangeable iid raters** drawn from a single category distribution. For non-exchangeable raters, use rater- identified data and `kappa(x, estimator = "cat_fiml")` instead.
To obtain counts from a rater-identified subjects-by-raters matrix, use [ratings_to_counts()]; chaining it into `estimator = "cat_fiml"` fits the exchangeable count-FIML.
Conger is not reported (raters are not identified in this input format), and neither IPW nor Gwet are meaningful (per-rater observation rates are aggregated away by the counts representation).
Arguments
- x
A subjects-by-categories non-negative integer matrix.
- estimator
Either `"fleiss_cuzick"` (the Fleiss-Cuzick count-format moment estimator) or `"cat_fiml"` (EM over the composition simplex with multivariate hypergeometric weights for completing partial counts). The two agree exactly when every row of `x` sums to `r_total`; with partial counts (some `r_i < r_total`) the `"cat_fiml"` estimator can be more efficient.
- weight
Weighting scheme: `"nominal"` (default), `"linear"`, or `"quadratic"`.
- values
Optional length-C numeric vector of category scores used by the metric weightings. Defaults to `1:C`.
- r_total
Total number of raters per subject. Defaults to the maximum observed row sum. Required for `estimator = "cat_fiml"` when rows have varying totals.
- em_options
Named list of EM options for `estimator = "cat_fiml"`: `tol`, `max_iter`, `prune_tol`, `start_alpha`, `info_rcond`. The raw-data `flatten` option does not apply here: the count-data FIML fits a low-dimensional composition model, not the saturated joint.
Value
A `misskappa_estimate` object with `Fleiss` and `Brennan-Prediger` coefficients, the 2x2 vcov, a `psi` component, and the registered `stats::influence` method.
Details
Older Krippendorff / irrCAC-style categorical schemes (`"ordinal"`, `"radical"`, `"ratio"`, `"circular"`, `"bipolar"`) remain available only through unsupported internal helpers and the C++ `misskappa::loss` factories; they are retained for validation and parity work, not as part of the recommended R interface.
References
Krippendorff, K. (2011). Computing Krippendorff's alpha-reliability.
Gwet, K. L. (2019). irrCAC: Computing chance-corrected agreement coefficients among raters.
Examples
# Fleiss (1971) psychiatric diagnoses: 30 subjects, 6 raters, 5 categories,
# in counts format (one row per subject, one column per category).
kappa_counts(dat.fleiss1971, estimator = "fleiss_cuzick")
#> misskappa: estimator=fleiss_cuzick, weight=nominal
#> estimate se lower upper
#> Fleiss 0.4302 0.0533 0.3258 0.5347
#> Brennan-Prediger 0.4444 0.0542 0.3382 0.5507
# Treat the categories as ordered scores with a quadratic loss.
kappa_counts(dat.fleiss1971, estimator = "fleiss_cuzick", weight = "quadratic")
#> misskappa: estimator=fleiss_cuzick, weight=quadratic
#> estimate se lower upper
#> Fleiss 0.2841 0.1093 0.0698 0.4983
#> Brennan-Prediger 0.3339 0.1019 0.1342 0.5336
