Take this example:
data <-matrix(c(227,751,193,541), ncol=2) column1 <- c(227, 751) probabilities <- c( 193/(193+541), 541/(193+541) ) chisq.test(data) chisq.test(column1, p= probabilities)
when i apply the chi-squared test providing a matrix the results says that this is a
Pearson's Chi-squared test with Yates' continuity correction
and provides a p-value of 0.158.
when i perform the second chi-squared, providing the first column of the matrix and the probabilities calculated from the second column the both the results and the name of the test change dramatically:
Chi-squared test for given probabilities
the reported p-value is 0.028.
considering that i am trying to determine if the two datasets i have (columns in the matrix) are NOT different from each other:
what is the difference between these two tests? which one should i use?