Skip to contents

Lin's concordance correlation coefficient (CCC; \(\rho_c\)) measures agreement between observations and predictions by combining Pearson correlation with differences in location and scale. Unlike Pearson correlation alone, CCC evaluates how closely paired values approach the line of equality.

Usage

ccc(obs, pred, na.rm = TRUE)

Arguments

obs

Numeric observation vector.

pred

Numeric prediction vector paired with obs.

na.rm

Logical; remove incomplete pairs?

Value

One numeric value between -1 and 1, with 1 indicating perfect agreement.

Details

$$ \rho_c = \frac{ 2\sum_{i=1}^{n}(obs_i-\bar{obs})(pred_i-\bar{pred}) }{ \sum_{i=1}^{n}(obs_i-\bar{obs})^2+ \sum_{i=1}^{n}(pred_i-\bar{pred})^2+ n(\bar{obs}-\bar{pred})^2 }. $$

CCC ranges from -1 to 1, with 1 indicating perfect agreement. Values decrease as observations and predictions differ in linear association, mean, or scale. Negative values indicate negative concordance.

CCC can also be expressed as

$$\rho_c = r C_b,$$

where \(r\) is the Pearson correlation coefficient and \(C_b\) is a bias-correction factor that accounts for departures from the line of equality. Consequently, CCC incorporates both association and agreement into a single statistic.

When CCC is used to evaluate predictive models, its value is most informative when considered together with complementary statistics. Different combinations of correlation, mean bias, and scale differences can produce similar CCC values, so the coefficient alone does not identify which component is responsible for disagreement between observations and predictions. In addition, CCC depends partly on the variability of the reference observations. Direct comparison of CCC values obtained from substantially different datasets or target populations should therefore be made with caution.

For prediction-model evaluation, CCC can usefully be reported alongside measures describing individual aspects of predictive performance, such as bias(), mae(), rmse(), correlation(), or R2(). This allows the overall concordance indicated by CCC to be interpreted together with the magnitude and sources of prediction error.

Population variances (divisor \(n\)) are used, matching the package convention. If either vector is constant and the displayed denominator is positive, CCC is zero, including a single unequal observation-prediction pair. Identical constant vectors have a zero denominator and return NA with a warning, as do inputs with no valid pairs. These conventions are symmetric in observations and predictions. Missing-value handling follows bias().

References

Lin, L. I.-K. (1989). A concordance correlation coefficient to evaluate reproducibility. Biometrics, 45, 255-268. doi:10.2307/2532051

Wadoux, A. M. J.-C. and Minasny, B. (2024). Some limitations of the concordance correlation coefficient to characterise model accuracy. Ecological Informatics, 83, 102820. doi:10.1016/j.ecoinf.2024.102820

Examples

obs <- c(1, 2, 3, 4, 5)

# Perfect agreement
ccc(obs, obs)
#> [1] 1

# Systematic bias reduces concordance
ccc(obs, obs + 1)
#> [1] 0.8

# Compare with Pearson correlation
correlation(obs, obs + 1)
#> [1] 1
ccc(obs, obs + 1)
#> [1] 0.8