# Differences in chi square test results

Hi,
I have got a 2x2 table:

The result of chi square test is 4.24.
When I do it with online calculator it is 4.24. as well.

When I do it in R:

``````data <- matrix(c(60, 40, 24, 32), byrow=TRUE, nrow=2)
colnames(data) <- c("Pass", "Fail")
rownames(data) <- c("Male", "Female")
View(data)
data %>% chisq.test()
``````

What do I do wrong ?
Where does that difference (between 4.24 and 3.58) come from ?

Remove the continuity correction.

``````library(tidyverse)

data <- matrix(c(60, 40, 24, 32), byrow=TRUE, nrow=2)
colnames(data) <- c("Pass", "Fail")
rownames(data) <- c("Male", "Female")
data
#>        Pass Fail
#> Male     60   40
#> Female   24   32
data %>% chisq.test(correct=FALSE)
#>
#>  Pearson's Chi-squared test
#>
#> data:  .
#> X-squared = 4.2449, df = 1, p-value = 0.03937
``````

Created on 2021-11-12 by the reprex package (v2.0.1)

Thank you StatSteph, now is OK.
https://stats.stackexchange.com/questions/362517/when-to-switch-off-the-continuity-correction-in-chisq-test-function

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.