GAgreement & reliability · agreement.gwet
Gwet's AC1/AC2 and other agreement coefficients
Do raters agree beyond chance in a way that is not distorted by very unequal category use (the kappa paradox)?
Gwet's AC1 (unweighted) or AC2 (weighted) for two or more raters with missing ratings, beside percent agreement, Brennan–Prediger and Fleiss' κ (generalized Scott's π) on the same data, each with Gwet's linearization standard error, a t interval and a one-sided test. AC1 stays stable when one category is very common, where κ-type coefficients collapse (Gwet 2008, 2014).
A real result
Example “Four raters missing”, recorded in both engines. In the app, “Try this example” loads it into Analyze.
AC1 = .78, 95% CI [0.46, 1.00], p < .001
- AC1
- 0.7754
- 95% CI
- [0.4608, 1]
- p (one-sided)
- < .001
- Percent agreement
- 0.8182
Effect size
- Gwet's AC1 0.7754 95% CI [0.4608, 1]
Plots
View data
| Estimate | Upper | Coefficient | Lower |
|---|---|---|---|
| 0.7754 | 1 | Gwet's AC1 | 0.4608 |
| 0.8182 | 1 | Percent agreement | 0.5417 |
| 0.7727 | 1 | Brennan–Prediger | 0.4542 |
| 0.7612 | 1 | Fleiss' κ (Scott's π) | 0.4244 |
Assumptions
- Sample size — 12 subjects (11 rated at least twice) by 4 raters — the interval is approximate.
- Category prevalence — The most common category holds 29% of the ratings.
Agreement coefficients (unweighted)
| Coefficient | Estimate | SE | 95% CI low | 95% CI high | p | Chance agreement |
|---|---|---|---|---|---|---|
| Gwet's AC1 | 0.7754 | 0.1429 | 0.4608 | 1 | < .001 | 0.1903 |
| Percent agreement | 0.8182 | 0.1256 | 0.5417 | 1 | — | 0 |
| Brennan–Prediger | 0.7727 | 0.1447 | 0.4542 | 1 | < .001 | 0.2000 |
| Fleiss' κ (Scott's π) | 0.7612 | 0.1530 | 0.4244 | 1 | < .001 | 0.2387 |
Category use
| Category | Share of ratings |
|---|---|
| 1 | 25.0% |
| 2 | 27.1% |
| 3 | 29.2% |
| 4 | 10.4% |
| 5 | 8.3% |
- Gwet (2008) linearization variance with n − 1 = 11 df; one-sided p for agreement > 0. Categories: 1, 2, 3, 4, 5.
AC1 = .78, 95% CI [0.46, 1.00], p < .001
- AC1
- 0.7754
- 95% CI
- [0.4608, 1]
- p (one-sided)
- < .001
- Percent agreement
- 0.8182
Effect size
- Gwet's AC1 0.7754 95% CI [0.4608, 1]
To keep this page light, the plots are shown once, under the R tab.
Assumptions
- Sample size — 12 subjects (11 rated at least twice) by 4 raters — the interval is approximate.
- Category prevalence — The most common category holds 29% of the ratings.
Agreement coefficients (unweighted)
| Coefficient | Estimate | SE | 95% CI low | 95% CI high | p | Chance agreement |
|---|---|---|---|---|---|---|
| Gwet's AC1 | 0.7754 | 0.1429 | 0.4608 | 1 | < .001 | 0.1903 |
| Percent agreement | 0.8182 | 0.1256 | 0.5417 | 1 | — | 0 |
| Brennan–Prediger | 0.7727 | 0.1447 | 0.4542 | 1 | < .001 | 0.2000 |
| Fleiss' κ (Scott's π) | 0.7612 | 0.1530 | 0.4244 | 1 | < .001 | 0.2387 |
Category use
| Category | Share of ratings |
|---|---|
| 1 | 25.0% |
| 2 | 27.1% |
| 3 | 29.2% |
| 4 | 10.4% |
| 5 | 8.3% |
- Gwet (2008) linearization variance with n − 1 = 11 df; one-sided p for agreement > 0. Categories: 1, 2, 3, 4, 5.
Do it in CodeSplash Run it on your own data, in Python or R, with the code to prove it.
Worked examples in the app
- Four raters missings3_kripp · raters: rater_1, rater_2, rater_3, rater 4
- Quadratic numerics3_kripp · raters: rater_1, rater_2, rater_3, rater 4
- Ordinal categoriess3_ratings · raters: judge_a, judge_b, judge c
- Boolean twos3_ratings · raters: flag_a, flag_b
- Linear categoricals3_kripp · raters: rater_1_cat, rater_2_cat, rater_3_cat
- Degenerate infs3_kripp · raters: rater_1, rater_2, rater_3, rater 4
In the guides
Where it sits in the decision guides
- Categorical (2 raters): Cohen's κ · Statistics Guide · G — Agreement / reliability
- Categorical (> 2 raters): Fleiss' κ · Statistics Guide · G — Agreement / reliability
- Agreement coefficients: Krippendorff α, Gwet AC1/AC2 · Statistics Guide · G — Agreement / reliability
What you need
- Raterscategorical / boolean / numeric · 2–100 columns · 1–50 levels
- One column per rater with the category given to each subject (rows). Missing ratings are allowed; numeric ratings are treated as ordered categories.
Choices you make
options
- Agreement weightsdefault identity
Partial credit for near-misses on an ordered scale (AC2). Categories use their stored order, numeric ratings their values.
- None — AC1 (categories are nominal)(default) — Counts only exact matches (AC1); pick it for unordered categories.
- Linear — Credit falls in a straight line with distance; pick it for ordered categories with equal steps.
- Quadratic — Credit falls with squared distance, so near misses lose little; the usual choice for ordered scales.
- Ordinal — Credit depends on rank distance; pick it for ordered categories with uneven steps.
- Radical (square root) — Credit falls with the square root of distance; stricter on near misses than linear.
- Ratio — Credit depends on relative size; pick it for numbers with a true zero.
hypothesis
- Confidence leveldefault 0.95
How sure the intervals should be: 0.95 gives 95% confidence intervals. Higher confidence means wider intervals.
Checks and remedies
CodeSplash checks each testable assumption on every run and shows the result on the card; premises the data can’t test are marked. If a check fails, these are the ways forward.
Sample size
The linearization variance and t interval need enough subjects.
Category prevalence
With one dominant category κ and π can be low despite high agreement (the kappa paradox); AC1 is designed for this case.
What it reports
- Tests: Agreement beyond chance (AC > 0)
- ac
- An agreement coefficient with a chance term that stays small when one category dominates, so it avoids the kappa paradox.
- ac_se
- The typical size of the error in an estimate, the standard deviation of its sampling distribution.
- ac_low
- A range of effect values compatible with your data at the chosen confidence level.
- ac_high
- A range of effect values compatible with your data at the chosen confidence level.
- ac_p
- How surprising your data would be if the null hypothesis were true, as a probability.
- ac_pe
- An agreement coefficient with a chance term that stays small when one category dominates, so it avoids the kappa paradox.
- pa
- Observed agreement is the share of ratings that match; chance agreement is the share expected to match anyway.
- pa_se
- The typical size of the error in an estimate, the standard deviation of its sampling distribution.
- pa_low
- A range of effect values compatible with your data at the chosen confidence level.
- pa_high
- A range of effect values compatible with your data at the chosen confidence level.
- bp
- Agreement beyond chance, taking chance as 1 over the number of categories whatever their shares.
- bp_se
- The typical size of the error in an estimate, the standard deviation of its sampling distribution.
- bp_low
- A range of effect values compatible with your data at the chosen confidence level.
- bp_high
- A range of effect values compatible with your data at the chosen confidence level.
- bp_p
- How surprising your data would be if the null hypothesis were true, as a probability.
- bp_pe
- Agreement beyond chance, taking chance as 1 over the number of categories whatever their shares.
- fleiss
- Chance-corrected agreement for several raters on a category, where different raters may judge each item.
- fleiss_se
- The typical size of the error in an estimate, the standard deviation of its sampling distribution.
- fleiss_low
- A range of effect values compatible with your data at the chosen confidence level.
- fleiss_high
- A range of effect values compatible with your data at the chosen confidence level.
- fleiss_p
- How surprising your data would be if the null hypothesis were true, as a probability.
- fleiss_pe
- Chance-corrected agreement for several raters on a category, where different raters may judge each item.
- n
- How many independent units the analysis used; it sets precision and power.
- n_rated
- How many independent units the analysis used; it sets precision and power.
- q
- Effect size for the difference between two correlations — the difference of their Fisher z values.
- raters
- How many raters (rating columns) were included in the agreement analysis.
- weighted
- 1 when disagreements were weighted by how far apart the categories are (Gwet's AC2), 0 when unweighted (AC1).
Per group, level or term: prop[<category>]
Python and R
Python and R agree to 10 decimals (relative tolerance 1e-10). Python uses pandas, numpy, scipy, codesplash; R uses stats, nanoparquet, codesplashr.
Default traps between the two languages
- Both engines use the same closed forms (codesplash.stats.agreement_adv.gwet_coefficients ↔ cs_agree_gwet), which reproduce irrCAC's gwet.ac1.raw, pa.coeff.raw, bp.coeff.raw and fleiss.kappa.raw before irrCAC rounds its printed estimates (Gwet's example: AC1 .77544, κ .76117, BP .77273). Categories follow the stored level order (irrCAC sorts category labels alphabetically), which matters only for weighted coefficients.
The exact script CodeSplash ran for example “Four raters missing” · Python 3.13.5 · scipy 1.18.1 · pandas 3.1.0
# Gwet's AC1/AC2 and other agreement coefficients
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method agreement.gwet 1.0.1 · spec 60ca4d60fe78e710
# Dataset: s3_kripp (version 1)
# Runs on its own: outside the app, cs.publish() writes $CS_RESULT_PATH or prints the result JSON.
# %% Setup
import json
import numpy as np
import pandas as pd
import codesplash as cs
from codesplash.stats import agreement_adv as ag # Gwet's coefficients (twin of R's cs_agree_gwet)
# irrCAC (R) computes the same coefficients: gwet.ac1.raw, pa.coeff.raw, bp.coeff.raw and
# fleiss.kappa.raw (it rounds the printed estimates; the twin keeps full precision).
# %% Data (missing ratings are kept; subjects nobody rated are left out)
raters = ["rater_1", "rater_2", "rater_3", "rater 4"]
kinds = {"rater 4":"numeric","rater_1":"numeric","rater_2":"numeric","rater_3":"numeric"}
stored = json.loads("{\"rater 4\":null,\"rater_1\":null,\"rater_2\":null,\"rater_3\":null}")
df = pd.read_parquet("tests/parity/fixtures/s3_kripp.parquet", columns=raters)
warnings = []
cs.check_finite_columns(df, raters) # infinite ratings stop the run (registry/errors.yaml)
if len({kinds[r] for r in raters}) > 1:
raise ValueError("All raters must use the same kind of value (all numbers or all categories)")
numeric = kinds[raters[0]] == "numeric"
if numeric:
raw = df[raters].to_numpy(dtype=float)
cat_values = np.unique(raw[~np.isnan(raw)])
cats = [f"{v:.0f}" if float(v).is_integer() else f"{v:.15g}" for v in cat_values]
codes = np.where(np.isnan(raw), np.nan, np.searchsorted(cat_values, np.nan_to_num(raw)))
else:
def text(s):
return [None if pd.isna(v) else (str(v).lower() if isinstance(v, (bool, np.bool_)) else str(v)) for v in s]
cols = {r: text(df[r]) for r in raters}
cats = []
for r in raters:
for v in stored[r] or sorted({v for v in cols[r] if v is not None}):
if v not in cats:
cats.append(v) # stored order across raters
pos = {c: i for i, c in enumerate(cats)}
codes = np.column_stack([[pos[v] if v is not None else np.nan for v in cols[r]] for r in raters]).astype(float)
cat_values = np.arange(1, len(cats) + 1, dtype=float)
rated = np.sum(~np.isnan(codes), axis=1) > 0
if (~rated).any():
warnings.append(f"{int((~rated).sum())} subjects without any rating were left out.")
codes = codes[rated]
q = len(cats)
if q < 2:
raise ValueError("The raters used only one category; chance-corrected agreement is undefined")
# %% Coefficients
conf = 0.95
weights = "identity"
w = ag.weights_matrix(weights, cat_values, numeric)
res = ag.gwet_coefficients(codes, q, w, conf)
weighted = weights != "identity"
name = "AC2" if weighted else "AC1"
nan = lambda v: None if v is None or not np.isfinite(v) else float(v) # noqa: E731
values = {}
for key, prefix in (("ac", "ac"), ("bp", "bp"), ("fleiss", "fleiss")):
r = res[key]
values.update({prefix: r["coeff"], f"{prefix}_se": nan(r["se"]), f"{prefix}_low": nan(r["ci_low"]), f"{prefix}_high": nan(r["ci_high"]),
f"{prefix}_p": nan(r["p"]), f"{prefix}_pe": r["pe"]})
pr = res["percent"]
values.update({"pa": pr["coeff"], "pa_se": nan(pr["se"]), "pa_low": nan(pr["ci_low"]), "pa_high": nan(pr["ci_high"]),
"n": float(res["n"]), "n_rated": float(res["n2"]), "q": float(q), "raters": float(len(raters)), "weighted": 1.0 if weighted else 0.0})
for c, p_c in zip(cats, res["pi"]):
values[f"prop[{c}]"] = float(p_c)
# %% Assumptions
top = float(np.max(res["pi"]))
assumptions = [
{"key": "sample_size", "label": "Sample size", "status": "warn" if res["n"] < 30 else "pass",
"detail": f"{res['n']} subjects ({res['n2']} rated at least twice) by {len(raters)} raters" + (" — the interval is approximate." if res["n"] < 30 else ".")},
{"key": "prevalence", "label": "Category prevalence", "status": "info" if top > 0.8 else "pass",
"detail": (f"One category holds {top:.0%} of the ratings: κ and π can be low despite high agreement (the kappa paradox); AC1 is designed for this case."
if top > 0.8 else f"The most common category holds {top:.0%} of the ratings.")},
]
# %% Result
pct = f"{conf:.0%}"
labels = {"percent": "Percent agreement", "ac": f"Gwet's {name}", "bp": "Brennan–Prediger", "fleiss": "Fleiss' κ (Scott's π)"}
rows = [{"coefficient": labels[k], "value": res[k]["coeff"], "se": nan(res[k]["se"]), "ci_low": nan(res[k]["ci_low"]), "ci_high": nan(res[k]["ci_high"]),
"p": nan(res[k]["p"]) if k != "percent" else None, "pe": res[k]["pe"]} for k in ("ac", "percent", "bp", "fleiss")]
ac = res["ac"]
cs.publish({
"method": "agreement.gwet",
"methodVersion": "1.0.1",
"title": f"Gwet's {name}",
"engine": cs.engine_info("numpy", "scipy", "codesplash"),
"n": int(res["n"]),
"summary": f"Gwet's {name} = {ac['coeff']:.3f}, {pct} CI [{ac['ci_low']:.3f}, {ac['ci_high']:.3f}] for {len(raters)} raters and {res['n']} subjects "
f"(percent agreement {pr['coeff']:.3f}, Fleiss' κ {res['fleiss']['coeff']:.3f}).",
"apa": f"{name} = {cs.fmt_num(ac['coeff'], 2, leading_zero=False)}, {pct} CI [{cs.fmt_num(ac['ci_low'])}, {cs.fmt_num(ac['ci_high'])}], {cs.fmt_p(ac['p'])}",
"statistics": [{"key": "ac", "label": name, "value": ac["coeff"]}, {"key": "ci", "label": f"{pct} CI", "value": [ac["ci_low"], ac["ci_high"]]},
{"key": "p", "label": "p (one-sided)", "value": ac["p"], "format": "p"}, {"key": "pa", "label": "Percent agreement", "value": pr["coeff"]}],
"tables": [{"key": "coefficients", "title": f"Agreement coefficients ({'weights: ' + weights if weighted else 'unweighted'})", "columns": [
{"key": "coefficient", "label": "Coefficient", "type": "string"}, {"key": "value", "label": "Estimate", "type": "number"},
{"key": "se", "label": "SE", "type": "number"}, {"key": "ci_low", "label": f"{pct} CI low", "type": "number"},
{"key": "ci_high", "label": f"{pct} CI high", "type": "number"}, {"key": "p", "label": "p", "type": "pvalue"},
{"key": "pe", "label": "Chance agreement", "type": "number"},
], "rows": rows},
{"key": "categories", "title": "Category use", "columns": [
{"key": "category", "label": "Category", "type": "string"}, {"key": "prop", "label": "Share of ratings", "type": "percent"}],
"rows": [{"category": c, "prop": float(p_c)} for c, p_c in zip(cats, res["pi"])]}],
"effectSizes": [{"key": "ac", "label": f"Gwet's {name}", "value": ac["coeff"], "ciLow": ac["ci_low"], "ciHigh": ac["ci_high"],
"ciLevel": conf, "method": "Gwet's linearization variance, t interval (upper bound capped at 1)"}],
"assumptions": assumptions,
"warnings": warnings,
"notes": [f"Gwet (2008) linearization variance with n − 1 = {res['n'] - 1} df; one-sided p for agreement > 0. Categories: {', '.join(cats)}."],
"charts": [cs.chart("coefficients", "forest", f"Agreement coefficients ({pct} CI)", {
"label": cs.col("Coefficient", [r["coefficient"] for r in rows], "categorical", levels=[r["coefficient"] for r in rows]),
"estimate": cs.col("Estimate", [r["value"] for r in rows], "numeric"),
"low": cs.col("Lower", [r["ci_low"] for r in rows], "numeric"),
"high": cs.col("Upper", [r["ci_high"] for r in rows], "numeric"),
}, controls={"reference": 0})],
"values": values,
})
The exact script CodeSplash ran for example “Four raters missing” · R version 4.5.1 (2025-06-13)
# Gwet's AC1/AC2 and other agreement coefficients
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method agreement.gwet 1.0.1 · spec 60ca4d60fe78e710
# Dataset: s3_kripp (version 1)
# Runs on its own: outside the app, cs_publish() writes $CS_RESULT_PATH or prints the result JSON.
# %% Setup
library(codesplashr)
# irrCAC computes the same coefficients: gwet.ac1.raw, pa.coeff.raw, bp.coeff.raw and
# fleiss.kappa.raw (it rounds the printed estimates; cs_agree_gwet keeps full precision).
# %% Data (missing ratings are kept; subjects nobody rated are left out)
raters <- c("rater_1", "rater_2", "rater_3", "rater 4")
kinds <- c(
"rater_1" = "numeric",
"rater_2" = "numeric",
"rater_3" = "numeric",
"rater 4" = "numeric"
)
stored <- list(
"rater_1" = NULL,
"rater_2" = NULL,
"rater_3" = NULL,
"rater 4" = NULL
)
df <- as.data.frame(nanoparquet::read_parquet("tests/parity/fixtures/s3_kripp.parquet", col_select = raters))
warnings <- list()
cs_check_finite_columns(df, raters) # infinite ratings stop the run (registry/errors.yaml)
if (length(unique(kinds)) > 1) stop("All raters must use the same kind of value (all numbers or all categories)")
numeric <- kinds[[1]] == "numeric"
if (numeric) {
raw <- matrix(sapply(raters, function(r) as.double(df[[r]])), ncol = length(raters))
cat_values <- sort(unique(raw[!is.na(raw)]))
cats <- vapply(cat_values, function(v) if (v == round(v)) sprintf("%.0f", v) else formatC(v, digits = 15, format = "g"), character(1))
codes <- matrix(match(raw, cat_values) - 1, nrow(raw))
} else {
text <- function(v) ifelse(is.na(v), NA_character_, if (is.logical(v)) tolower(as.character(v)) else as.character(v))
cols <- lapply(raters, function(r) text(df[[r]]))
names(cols) <- raters
cats <- character(0)
for (r in raters) {
lv <- if (!is.null(stored[[r]])) stored[[r]] else sort(unique(stats::na.omit(cols[[r]])), method = "radix")
for (v in lv) if (!(v %in% cats)) cats <- c(cats, v) # stored order across raters
}
codes <- matrix(as.double(sapply(raters, function(r) match(cols[[r]], cats) - 1)), ncol = length(raters))
cat_values <- as.double(seq_along(cats))
}
rated <- rowSums(!is.na(codes)) > 0
if (any(!rated)) warnings <- c(warnings, sprintf("%d subjects without any rating were left out.", sum(!rated)))
codes <- codes[rated, , drop = FALSE]
q <- length(cats)
if (q < 2) stop("The raters used only one category; chance-corrected agreement is undefined")
# %% Coefficients
conf <- 0.95
weights <- "identity"
w <- cs_agree_weights(weights, cat_values, numeric)
res <- cs_agree_gwet(codes, q, w, conf)
weighted <- weights != "identity"
name <- if (weighted) "AC2" else "AC1"
fin <- function(v) if (is.null(v) || !is.finite(v)) NA else unname(v)
values <- list()
for (k in c("ac", "bp", "fleiss")) {
r <- res[[k]]
values[[k]] <- r$coeff
values[[paste0(k, "_se")]] <- fin(r$se)
values[[paste0(k, "_low")]] <- fin(r$ci_low)
values[[paste0(k, "_high")]] <- fin(r$ci_high)
values[[paste0(k, "_p")]] <- fin(r$p)
values[[paste0(k, "_pe")]] <- r$pe
}
pr <- res$percent
values$pa <- pr$coeff
values$pa_se <- fin(pr$se)
values$pa_low <- fin(pr$ci_low)
values$pa_high <- fin(pr$ci_high)
values$n <- res$n
values$n_rated <- res$n2
values$q <- q
values$raters <- length(raters)
values$weighted <- if (weighted) 1 else 0
for (i in seq_along(cats)) values[[sprintf("prop[%s]", cats[i])]] <- res$pi[i]
# %% Assumptions
top <- max(res$pi)
assumptions <- list(
list(key = "sample_size", label = "Sample size", status = if (res$n < 30) "warn" else "pass",
detail = paste0(sprintf("%d subjects (%d rated at least twice) by %d raters", res$n, res$n2, length(raters)),
if (res$n < 30) " — the interval is approximate." else ".")),
list(key = "prevalence", label = "Category prevalence", status = if (top > 0.8) "info" else "pass",
detail = if (top > 0.8) sprintf("One category holds %.0f%% of the ratings: κ and π can be low despite high agreement (the kappa paradox); AC1 is designed for this case.", 100 * top)
else sprintf("The most common category holds %.0f%% of the ratings.", 100 * top))
)
# %% Result
pct <- sprintf("%.0f%%", conf * 100)
labels <- c(percent = "Percent agreement", ac = paste("Gwet's", name), bp = "Brennan–Prediger", fleiss = "Fleiss' κ (Scott's π)")
rows <- lapply(c("ac", "percent", "bp", "fleiss"), function(k) {
r <- res[[k]]
list(coefficient = unname(labels[k]), value = r$coeff, se = fin(r$se), ci_low = fin(r$ci_low), ci_high = fin(r$ci_high),
p = if (k != "percent") fin(r$p) else NA, pe = r$pe)
})
ac <- res$ac
coef_labels <- vapply(rows, function(r) r$coefficient, character(1))
cs_publish(list(
method = "agreement.gwet",
methodVersion = "1.0.1",
title = paste("Gwet's", name),
engine = cs_engine_info("stats", "codesplashr"),
n = res$n,
summary = sprintf("Gwet's %s = %.3f, %s CI [%.3f, %.3f] for %d raters and %d subjects (percent agreement %.3f, Fleiss' κ %.3f).",
name, ac$coeff, pct, ac$ci_low, ac$ci_high, length(raters), res$n, pr$coeff, res$fleiss$coeff),
apa = sprintf("%s = %s, %s CI [%s, %s], %s", name, cs_fmt_num(ac$coeff, 2, leading_zero = FALSE), pct, cs_fmt_num(ac$ci_low),
cs_fmt_num(ac$ci_high), cs_fmt_p(ac$p)),
statistics = list(list(key = "ac", label = name, value = ac$coeff), list(key = "ci", label = paste(pct, "CI"), value = c(ac$ci_low, ac$ci_high)),
list(key = "p", label = "p (one-sided)", value = ac$p, format = "p"), list(key = "pa", label = "Percent agreement", value = pr$coeff)),
tables = list(
list(key = "coefficients", title = sprintf("Agreement coefficients (%s)", if (weighted) paste("weights:", weights) else "unweighted"), columns = list(
list(key = "coefficient", label = "Coefficient", type = "string"), list(key = "value", label = "Estimate", type = "number"),
list(key = "se", label = "SE", type = "number"), list(key = "ci_low", label = paste(pct, "CI low"), type = "number"),
list(key = "ci_high", label = paste(pct, "CI high"), type = "number"), list(key = "p", label = "p", type = "pvalue"),
list(key = "pe", label = "Chance agreement", type = "number")
), rows = rows),
list(key = "categories", title = "Category use", columns = list(
list(key = "category", label = "Category", type = "string"), list(key = "prop", label = "Share of ratings", type = "percent")),
rows = lapply(seq_along(cats), function(i) list(category = cats[i], prop = res$pi[i])))
),
effectSizes = list(list(key = "ac", label = paste("Gwet's", name), value = ac$coeff, ciLow = ac$ci_low, ciHigh = ac$ci_high,
ciLevel = conf, method = "Gwet's linearization variance, t interval (upper bound capped at 1)")),
assumptions = assumptions,
warnings = warnings,
notes = list(sprintf("Gwet (2008) linearization variance with n − 1 = %d df; one-sided p for agreement > 0. Categories: %s.", res$n - 1, paste(cats, collapse = ", "))),
charts = list(cs_chart("coefficients", "forest", sprintf("Agreement coefficients (%s CI)", pct), list(
label = cs_col("Coefficient", coef_labels, "categorical", levels = coef_labels),
estimate = cs_col("Estimate", vapply(rows, function(r) r$value, numeric(1)), "numeric"),
low = cs_col("Lower", vapply(rows, function(r) r$ci_low, numeric(1)), "numeric"),
high = cs_col("Upper", vapply(rows, function(r) r$ci_high, numeric(1)), "numeric")
), controls = list(reference = 0))),
values = values
))
Sources
- Gwet, K. L. (2008). Computing inter-rater reliability and its variance in the presence of high agreement. British Journal of Mathematical and Statistical Psychology, 61, 29–48.
- Gwet, K. L. (2014). Handbook of inter-rater reliability (4th ed.). Advanced Analytics.
- Brennan, R. L., & Prediger, D. J. (1981). Coefficient kappa: Some uses, misuses, and alternatives. Educational and Psychological Measurement, 41, 687–699.
From the CodeSplash method registry · agreement.gwet v1.0.1.