Learn R Programming

L1pack (version 0.60)

l1ccc: L1 concordance correlation coefficient

Description

Calculates L1 concordance correlation coefficient for evaluating the degree of agreement between measurements generated by two different methods.

Usage

l1ccc(x, data, equal.means = FALSE, boots = TRUE, nsamples = 1000, subset, na.action)

Value

A list with class 'l1ccc' containing the following named components:

call

a list containing an image of the ccc call that produced the object.

x

data.frame used in the estimation process.

rho1

L1 estimate of the concordance correlation coefficient.

var.rho1

approximate variance of the L1 concordance correlation coefficient, only present if boots = TRUE.

L1

list with L1 estimates using Laplace, and normal distributions, and U-statistics.

Lin

Lin's concordance correlation coefficient under the Laplace distribution.

ustat

L1 estimation of concordance coefficient using U-statistics, a list containing the following elements rho1, var.rho1, ustat, and cov.

center

the estimated mean vector.

Scatter

the estimated Scatter (or Scale) matrix.

logLik

the log-likelihood at convergence.

weights

estimated weights corresponding to the Laplace distribution.

Restricted

available only if equal.means = TRUE, in which case this element corresponds to a list containing the following elements ccc, rho1, var.rho1, accuracy, precision, shifts, and information about the restrcited Fitted model.

Arguments

x

a formula or a numeric matrix or an object that can be coerced to a numeric matrix.

data

an optional data frame (or similar: see model.frame), used only if x is a formula. By default the variables are taken from environment(formula).

equal.means

logical, should the means of the measuring devices be considered equal? In which case the restricted estimation is carried out under this assumption.

boots

logical, hould use bootstrap to approximate the variances of the L1 estimators.

nsamples

number of bootstrap samples (default to 1000), only used if boots = TRUE.

subset

an optional expression indicating the subset of the rows of data that should be used in the fitting process.

na.action

a function that indicates what should happen when the data contain NAs.

References

King, T.S., Chinchilli, V.M. (2001). A generalized concordance correlation coefficient for continuous and categorical data. Statistics in Medicine 20, 2131-2147.

King, T.S., Chinchilli, V.M. (2001). Robust estimators of the concordance correlation coefficient. Journal of Biopharmaceutical Statistics 11, 83-105.

Lin, L. (1989). A concordance correlation coefficient to evaluate reproducibility. Biometrics 45, 255-268.

Vallejos, R., Osorio, F., Ferrer, C. (2025+). A new coefficient to measure agreement between two continuous variables. Working paper.

Examples

Run this code
## data from Bland and Altman (1986). The Lancet 327, 307-310.
x <- list(Large = c(494,395,516,434,476,557,413,442,650,433,
          417,656,267,478,178,423,427),
          Mini  = c(512,430,520,428,500,600,364,380,658,445,
          432,626,260,477,259,350,451))
x <- as.data.frame(x)

plot(Mini ~ Large, data = x, xlim = c(100,800), ylim = c(100,800),
     xlab = "PERF by Large meter", ylab = "PERF by Mini meter")
abline(c(0,1), col = "gray", lwd = 2)

## estimating L1 concordance coefficient
z <- l1ccc(~ Mini + Large, data = x, boots = FALSE)
z
## output:
# Call:
# l1ccc(x = ~ Mini + Large, data = x, boots = FALSE)
#
# L1 coefficients using:
# Laplace  Gaussian  U-statistic 
#  0.7456    0.7607       0.7642 
#
# Lin's coefficients:
# estimate  accuracy precision 
#   0.9395    0.9974    0.9419 

Run the code above in your browser using DataLab