Package 'scindex'

Title: Strategic Convergence Index for Inter-Rater Reliability
Description: Inter-rater reliability analysis for binary classification tasks involving two or more raters within a signal detection-theoretic framework. User-supplied rating data are standardised into a common long-format structure. The package automatically computes Cohen's kappa for two raters and Fleiss' kappa for multiple raters. When ground-truth labels are available, rater-specific hit rates, false-alarm rates, sensitivity, specificity, and decision thresholds are estimated from observed classification responses using standard signal detection-theoretic transformations (DeCarlo, 1998) <doi:10.1037/1082-989X.3.2.186>. The package implements the Strategic Convergence Index (SCI; Gianeselli, 2026) <doi:10.1177/00131644261417643>, computed as SCI = max(0, 1 - [Var(t_i) / Var_max]), where Var(t_i) denotes the sample variance of rater-specific decision thresholds and Var_max denotes the reference variance of a uniform distribution over a specified threshold interval (Gianeselli, 2026) <doi:10.1177/00131644261455307>. SCI quantifies convergence in rater decision criteria beyond observed agreement alone and complements classical agreement coefficients by distinguishing agreement in observed categorical outcomes from convergence in latent decision thresholds under an explicit signal detection-theoretic model of categorical judgment. The package provides structured summaries and threshold-based diagnostics for applications in which similar agreement coefficients may reflect substantively different underlying decision criteria across raters.
Authors: Irene Gianeselli [aut, cre] (ORCID: <https://orcid.org/0000-0002-8689-3035>)
Maintainer: Irene Gianeselli <[email protected]>
License: GPL-3
Version: 0.1.1
Built: 2026-11-27 04:11:11 UTC
Source: https://github.com/cran/scindex

Help Index


Estimate SDT Decision Thresholds

Description

Internal utility for estimating signal-detection-theoretic (SDT) decision criteria from binary ratings and observed ground-truth labels.

Usage

estimate_sdt_thresholds(
  data,
  item_col,
  rater_col,
  rating_col,
  truth_col,
  positive = 1
)

Arguments

data

A preprocessed long-format data frame containing rater identifiers, binary ratings, and binary ground-truth labels. Ratings and ground-truth labels must be coded as 0 and 1.

item_col

Character string identifying the item column. Retained in the function interface but not used directly in the estimation of rater-specific decision criteria.

rater_col

Character string identifying the rater column.

rating_col

Character string identifying the binary rating column.

truth_col

Character string identifying the binary ground-truth column.

positive

Original value identifying the positive category. Retained in the function interface but not used directly, because ratings and ground-truth labels have already been recoded during preprocessing.

Details

The function operates on preprocessed long-format data in which ratings and ground-truth labels have been recoded into binary values. The positive category is coded as 1 and the negative category as 0.

Each rater must have observations in both ground-truth categories. All available observations for each rater are used, including observations from items with incomplete ratings across raters.

Log-linear correction

For each rater, let hih_i, mim_i, fif_i, and rir_i denote the observed numbers of hits, misses, false alarms, and correct rejections, respectively.

The numbers of signal and noise observations are

nS,i=hi+min_{S,i} = h_i + m_i

and

nN,i=fi+rin_{N,i} = f_i + r_i

The hit rate and false-alarm rate are estimated using the log-linear correction described by Hautus (1995):

Hi=hi+0.5nS,i+1H_i = \frac{h_i + 0.5}{n_{S,i} + 1}

Fi=fi+0.5nN,i+1F_i = \frac{f_i + 0.5}{n_{N,i} + 1}

The correction is applied to all classification counts, including those for raters whose uncorrected proportions are already strictly between 0 and 1. It ensures that the corrected rates lie strictly between 0 and 1, preventing infinite standard normal quantiles.

SDT decision criteria

The decision criterion for rater i is computed as

ti=−12[Φ−1(Hi)+Φ−1(Fi)]t_i = -\frac{1}{2} [\Phi^{-1}(H_i) + \Phi^{-1}(F_i)]

where Φ−1\Phi^{-1} denotes the inverse cumulative distribution function of the standard normal distribution.

Under the equal-variance Gaussian SDT model, the estimated criterion is expressed in standard deviation units relative to the midpoint of the class-conditional evidence distributions (DeCarlo, 1998; Macmillan & Creelman, 2005).

Negative criterion values indicate a liberal decision criterion, positive values indicate a conservative decision criterion, and zero indicates a criterion located at the midpoint of the class-conditional evidence distributions.

A criterion of zero does not imply optimal classification performance or high discriminative ability.

Classification performance

Sensitivity, specificity, and accuracy are computed directly from the observed classification counts, without applying the log-linear correction:

Sensitivityi=hinS,i\mathrm{Sensitivity}_i = \frac{h_i}{n_{S,i}}

Specificityi=rinN,i\mathrm{Specificity}_i = \frac{r_i}{n_{N,i}}

Accuracyi=hi+rinS,i+nN,i\mathrm{Accuracy}_i = \frac{h_i + r_i}{n_{S,i} + n_{N,i}}

These quantities describe observed classification performance and are distinct from the corrected proportions used to estimate the SDT decision criterion.

Dispersion of decision criteria

The arithmetic mean and sample variance of the estimated decision criteria are computed across raters.

For K raters, the sample variance is

st2=1K−1∑i=1K(ti−tˉ)2s_t^2 = \frac{1}{K-1}\sum_{i=1}^{K}(t_i-\bar{t})^2

Each rater contributes equally to the calculation, irrespective of the number of observations available for that rater.

Value

A list containing the following components:

thresholds

A data frame with one row per rater and the following columns:

rater

Rater identifier.

hit_rate

Log-linearly corrected hit rate.

false_alarm_rate

Log-linearly corrected false-alarm rate.

z_hit

Standard normal quantile of the corrected hit rate.

z_false_alarm

Standard normal quantile of the corrected false-alarm rate.

threshold

Estimated SDT decision criterion in standard deviation units relative to the midpoint of the class-conditional evidence distributions.

sensitivity

Uncorrected empirical sensitivity.

specificity

Uncorrected empirical specificity.

accuracy

Proportion of correctly classified observations.

mean_threshold

Arithmetic mean of the estimated decision criteria across raters.

threshold_variance

Sample variance of the estimated decision criteria across raters, computed using a denominator of K - 1.

References

DeCarlo, L. T. (1998). Signal detection theory and generalized linear models. Psychological Methods, 3(2), 186–205. doi:10.1037/1082-989X.3.2.186

Hautus, M. J. (1995). Corrections for extreme proportions and their biasing effects on estimated values of d'. Behavior Research Methods, Instruments, & Computers, 27(1), 46–51. doi:10.3758/BF03203619

Macmillan, N. A., & Creelman, C. D. (2005). Detection theory: A user's guide (2nd ed.). Lawrence Erlbaum Associates. doi:10.4324/9781410611147


Print a scindex Object

Description

Print method for objects of class "scindex_fit".

Usage

## S3 method for class 'scindex_fit'
print(x, digits = 3, ...)

Arguments

x

An object of class "scindex_fit".

digits

Number of digits to print.

...

Additional arguments (unused).

Details

The method displays:

  • agreement coefficient;

  • agreement type;

  • SCI when available;

  • basic sample information;

  • number of items used for agreement when this differs from the total number of items.

Value

Invisibly returns x.


Compute Agreement and the Strategic Convergence Index

Description

scindex() computes classical inter-rater agreement and, when a ground-truth variable is available, the Strategic Convergence Index (SCI). The function automatically returns Cohen's kappa for two raters and Fleiss' kappa for more than two raters.

Usage

scindex(
  data,
  item,
  rater,
  rating,
  truth = NULL,
  positive = 1,
  variance_bounds = NULL
)

Arguments

data

A data frame containing item identifiers, rater identifiers, ratings, and optionally ground-truth labels. At least two raters are required.

item

Unquoted column name identifying the rated item or case.

rater

Unquoted column name identifying the rater.

rating

Unquoted column name containing the categorical rating. Ratings must contain exactly two observed categories across the supplied data.

truth

Optional unquoted column name containing the ground-truth label. If supplied, SDT thresholds and SCI are computed. Ground-truth labels must contain exactly two observed categories, use the same category coding as rating, and be identical across observations of the same item. Each rater must have observations in both ground-truth categories.

positive

A single non-missing value identifying the positive class. It must correspond to one of the observed rating categories. Defaults to 1.

variance_bounds

Optional numeric vector containing two finite values defining the lower and upper limits of the reference threshold interval, with the lower limit strictly smaller than the upper limit. The resulting reference variance must be finite and strictly positive when SCI is computed. If NULL, symmetric empirical bounds are derived from the largest absolute estimated threshold, with a minimum absolute bound of 1.

Details

SCI is a model-based index of convergence in rater decision criteria. It complements agreement coefficients by quantifying dispersion in estimated signal-detection-theoretic (SDT) criteria independently of the calculation of observed classification agreement.

Input requirements

Data must be supplied in long format, with one row per observed item-rater combination. Missing values are not permitted in the columns used for analysis. Each item-rater combination must occur only once.

Incomplete rating panels are permitted when unobserved item-rater combinations are represented by absent rows, provided that the remaining input requirements are satisfied.

Ratings and ground-truth labels, when supplied, are internally recoded into binary values, with the category specified by positive coded as 1 and the other category coded as 0.

Agreement coefficients

Agreement coefficients are computed using items with complete ratings across all raters. At least one complete item is required.

When the denominator of the kappa coefficient is zero, kappa is undefined and is returned as NA.

The number of items used for agreement is reported in the agreement component of the returned object. The print and summary methods also report this number when it differs from the total number of items.

SDT decision criteria

SDT criteria are estimated using all available observations for each rater, including observations from items excluded from the agreement calculation because of incomplete ratings.

Hit rates and false-alarm rates are estimated using a log-linear correction to avoid infinite normal quantiles. The decision criterion for rater i is computed as

ti=−12[Φ−1(Hi)+Φ−1(Fi)]t_i = -\frac{1}{2} [\Phi^{-1}(H_i) + \Phi^{-1}(F_i)]

where H and F denote the corrected hit rate and false-alarm rate, respectively, and the inverse standard normal cumulative distribution function is applied to both rates.

The resulting criteria are expressed in standard deviation units relative to the midpoint of the class-conditional evidence distributions under the equal-variance Gaussian SDT model.

Sensitivity, specificity, and accuracy are computed from the observed classification counts without the log-linear correction.

Strategic Convergence Index

SCI is computed as

SCI=max⁡(0,1−st2Vref)\mathrm{SCI} = \max\left(0, 1 - \frac{s_t^2}{V_{\mathrm{ref}}}\right)

where the sample variance of the estimated rater-specific decision criteria is

st2=1K−1∑i=1K(ti−tˉ)2s_t^2 = \frac{1}{K-1}\sum_{i=1}^{K}(t_i-\bar{t})^2

and K denotes the number of raters.

The reference variance is defined as

Vref=(b−a)212V_{\mathrm{ref}} = \frac{(b-a)^2}{12}

where a and b are the lower and upper limits of the reference threshold interval, respectively. This quantity is the variance of a uniform distribution over the specified interval. It is not the maximum attainable variance of thresholds within that interval.

SCI ranges from 0 to 1. A value of 1 indicates zero dispersion in the estimated decision criteria. When the observed threshold variance equals or exceeds the reference variance, SCI is set to 0.

The reference interval is used exclusively for normalisation. Its limits do not constrain or truncate the estimated decision criteria.

If variance_bounds is NULL, symmetric empirical bounds are defined by the interval [−B,B][-B, B], where

B=max⁡(1,max⁡i∣ti∣)B = \max(1, \max_i |t_i|)

Consequently, the reference variance may differ across rating panels when empirical bounds are used. Comparisons across panels or conditions should use common fixed bounds and a common SDT criterion scale.

SCI describes convergence in estimated decision criteria. A high SCI does not necessarily imply high observed agreement, discriminative performance, or classification accuracy.

Value

An object of class "scindex_fit" containing the following components:

kappa

The estimated agreement coefficient. Returns NA when kappa is undefined.

kappa_type

A character string identifying the agreement coefficient as Cohen's kappa or Fleiss' kappa.

agreement

A list containing the agreement coefficient, observed agreement, expected agreement, the number of complete items used for agreement, and coefficient-specific diagnostic information.

sci

The Strategic Convergence Index. Returns NA_real_ when ground-truth labels are not supplied.

thresholds

A data frame containing rater identifiers, corrected hit rates and false-alarm rates, their standard normal quantiles, estimated SDT decision criteria, sensitivity, specificity, and accuracy. Returns NULL when ground-truth labels are not supplied.

sdt

A list containing the rater-specific SDT estimates, the mean decision criterion, and the sample variance of the estimated criteria. Returns NULL when ground-truth labels are not supplied.

threshold_variance

The sample variance of the estimated decision criteria. Returns NA_real_ when ground-truth labels are not supplied.

n_raters

The total number of raters in the supplied data.

n_items

The total number of distinct items in the supplied data, including items with incomplete ratings.

truth_available

A logical value indicating whether ground-truth labels were supplied.

positive

The original value identifying the positive class.

call

The matched function call.

Examples

ratings <- data.frame(
  item = rep(1:6, each = 2),
  rater = rep(c("A", "B"), times = 6),
  rating = c(1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1),
  truth = rep(c(1, 0, 1, 1, 0, 1), each = 2)
)

fit <- scindex(
  data = ratings,
  item = item,
  rater = rater,
  rating = rating,
  truth = truth
)

fit

Example Binary Inter-Rater Dataset

Description

Simulated binary classification ratings from two raters across eight items, including ground-truth labels.

Usage

data(scindex_example)

Format

A data frame with 16 rows and 4 variables:

item

Integer identifier of the rated item, ranging from 1 to 8.

rater

Character identifier of the rater, either A or B.

rating

Numeric binary classification assigned by the rater, coded as 0 or 1.

truth

Numeric binary ground-truth classification, coded as 0 or 1 and shared by both raters for each item.

Details

The dataset represents a complete rating panel in which each of the eight items is evaluated by both raters. Four items belong to the positive ground-truth category and four belong to the negative ground-truth category.

Both ratings and ground-truth labels are coded as 0 and 1, with 1 identifying the positive category.

The dataset illustrates the computation and complementary interpretation of Cohen's kappa and the Strategic Convergence Index (SCI).

The two raters differ in observed classification performance but have identical estimated signal-detection-theoretic decision criteria. The resulting Cohen's kappa is 0.5, whereas SCI is 1.

This example illustrates that complete convergence in estimated decision criteria does not necessarily imply perfect observed agreement, equal discriminative ability, or identical classification accuracy.

The data are intended for methodological illustration and software demonstration.

Source

Simulated example data.

Examples

data(scindex_example)

fit <- scindex(
  data = scindex_example,
  item = item,
  rater = rater,
  rating = rating,
  truth = truth
)

fit
summary(fit)

Example Binary Inter-Rater Dataset with Multiple Raters

Description

Simulated binary classification ratings from three raters across eight items, including ground-truth labels.

Usage

data(scindex_example_multi)

Format

A data frame with 24 rows and 4 variables:

item

Integer identifier of the rated item, ranging from 1 to 8.

rater

Character identifier of the rater, either A, B, or C.

rating

Numeric binary classification assigned by the rater, coded as 0 or 1.

truth

Numeric binary ground-truth classification, coded as 0 or 1 and shared by all three raters for each item.

Details

The dataset represents a complete rating panel in which each of the eight items is evaluated by all three raters. Four items belong to the positive ground-truth category and four belong to the negative ground-truth category.

Both ratings and ground-truth labels are coded as 0 and 1, with 1 identifying the positive category.

The dataset illustrates the computation and complementary interpretation of Fleiss' kappa and the Strategic Convergence Index (SCI) in a multi-rater setting.

The three raters differ in observed classification performance. Raters A and C have identical estimated signal-detection-theoretic decision criteria, whereas rater B has a negative estimated criterion. The resulting Fleiss' kappa is approximately 0.497.

The sample variance of the estimated decision criteria is approximately 0.04777. With the default empirical reference interval, SCI is approximately 0.857. When fixed reference bounds of -3 and 3 are supplied, SCI is approximately 0.984.

This example illustrates the dependence of SCI on the reference variance used for normalisation. The estimated decision criteria, their sample variance, and the agreement coefficient remain unchanged when the reference bounds are varied.

Comparisons of SCI across rating panels or conditions should use common fixed reference bounds and a common SDT criterion scale.

The data are intended for methodological illustration and software demonstration.

Source

Simulated example data.

Examples

data(scindex_example_multi)

# SCI with default empirical reference bounds
fit <- scindex(
  data = scindex_example_multi,
  item = item,
  rater = rater,
  rating = rating,
  truth = truth
)

fit
summary(fit)

# SCI with fixed reference bounds
fit_fixed <- scindex(
  data = scindex_example_multi,
  item = item,
  rater = rater,
  rating = rating,
  truth = truth,
  variance_bounds = c(-3, 3)
)

fit_fixed

# Compare SCI under the two normalisation settings
c(
  empirical = fit$sci,
  fixed = fit_fixed$sci
)

Summarize a scindex Object

Description

Summary method for objects of class "scindex_fit".

Usage

## S3 method for class 'scindex_fit'
summary(object, digits = 3, ...)

Arguments

object

An object of class "scindex_fit".

digits

Number of digits to print.

...

Additional arguments (unused).

Details

The method returns a structured summary including the agreement coefficient, SCI when available, SDT threshold estimates, and basic diagnostic information. When the number of items used for agreement differs from the total number of items, both quantities are reported.

Value

Invisibly returns object.