Learn R Programming

concordancer (version 1.0.2)

ccc: An Rcpp implementation of Lin's Concordance Correlation Coefficient (CCC)

Description

This ccc() function leverages the speed of C++ to implement Lin's Concordance Correlation Coefficient (CCC) via Rcpp. This implementation is faster than other varieties of CCC calculation from other packages, i.e., DescTools::CCC() and epiR::epi.ccc().

Usage

ccc(x, y)

Value

A numeric scalar representing the CCC between x and y.

Arguments

x

A numeric vector containing x.

y

A numeric vector containing y.

Details

For more details on the calculation of the CCC, see: https://en.wikipedia.org/wiki/Concordance_correlation_coefficient

Examples

Run this code
# Create x and y vectors
x <- rnorm(100, sd = 1)
y <- rnorm(length(x), sd = 0.2)

# Calculate CCC between x and y
ccc(x,y)

Run the code above in your browser using DataLab