Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difference Values of CCC Between Implementations #2

Open
nathanhaigh opened this issue Aug 14, 2023 · 1 comment
Open

Difference Values of CCC Between Implementations #2

nathanhaigh opened this issue Aug 14, 2023 · 1 comment

Comments

@nathanhaigh
Copy link

Can you explain why the CCC calculated by condordancer is different to that calculated by two other packages?

library("concordancer")
library("DescTools")
library("epiR")

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

# Calculate CCC using 3 different packages
c <- concordancer::ccc(x, y)
d <- DescTools::CCC(x, y)
e <- epiR::epi.ccc(x, y)

# Look at their CCC
c
[1] -0.01593504
d$rho.c["est"]
          est
1 -0.01593447
e$rho.c["est"]
          est
1 -0.01593447
@nathanhaigh
Copy link
Author

In case you want to provide microbenchmark results:

library(microbenchmark)
library(ggplot2)

library(concordancer)
library(DescTools)
library(epiR)

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

# Perform microbenchmarking
ccc_mbm <- microbenchmark(
  concordancer = concordancer::ccc(x, y),
  DescTools = DescTools::CCC(x, y)$rho.c["est"],
  epiR = epiR::epi.ccc(x, y)$rho.c["est"],
  
  check = NULL
)

# Plot microbenchmarking result
autoplot(ccc_mbm)

image

However, the comparison might not be "fair" since both DescTools and epiR also calculate and return other information such as confidence intervals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant