Computes the Concordance Correlation Coefficient (CCC) between two numeric
vectors.
The CCC assesses the agreement between two sets of measurements by combining
measures of both precision (correlation) and accuracy (closeness to the
identity line).
Usage
ccc(x, y, bias_correction = TRUE)
Arguments
- x
A numeric vector of predicted or measured values.
- y
A numeric vector of observed or reference values. Must be the same
length as x
.
- bias_correction
Logical. If TRUE
, applies a bias correction by
using sample variance and covariance estimators (i.e., dividing by
\(n - 1\) instead of \(n\)).
Value
A numeric value between -1 and 1 indicating the level of concordance.
A value of 1 indicates perfect agreement.
References
Lawrence I-Kuei Lin. (1989). A Concordance Correlation Coefficient to Evaluate Reproducibility. Biometrics, 45(1), 255–268. https://doi.org/10.2307/2532051
Examples
x <- c(1, 2, 3, 4, 5)
y <- c(1.1, 1.9, 3.2, 4.1, 4.8)
ccc(x, y) # Unbiased sample-based method
#> [1] 0.9943241
ccc(x, y, bias_correction = FALSE) # Lin's original population method
#> [1] 0.9943035