Closed huftis closed 2 years ago
Thank you for your submission, I will investigate and report back ASAP.
Thanks for reporting! The bug seems to happen whenever abs(n[1, 1] * n[2, 2] - n[1, 2] * n[2, 1]) - (N / 2)) < 0
, so that expression has been wrapped around max(0, ...)
(see theoretical reference here). The fix is already on our develop
branch (contingencytables 1.0.1.9000) and should be available within a few days on CRAN (contingencytables 1.0.2).
For the record: contingencytables 1.0.2 is on CRAN with the fix. 😄
The
Pearson_chi_squared_test_CC_2x2()
function should return the same results aschisq.test(..., correct = TRUE)
. It does so for the contingency tables in the help file, but not for all contingency tables. Example:In fact, for this table, the functions returns a lower P-value (0.61) than the corresponding function(s) that don’t use continuity correction (0.91):