2
$\begingroup$

I am trying to use the Chi-Square test for independence of attributes. My dataset has only two columns, but several thousands of rows. Consequently the degree of freedom is also very high.

When I use chisq.test in R, I get the following warning message:

Warning message: In chisq.test(myVariable) : Chi-squared approximation may be incorrect

Am I using the correct test here? Are there better alternatives? I understand that the chi-square distribution is practically a Normal distribution in this case!

Thanks and regards,

$\endgroup$
  • $\begingroup$ Actually, that warning is because the chi-square distribution (whether or not it is close to Normally distributed) might not be a good approximation to the actual distribution of the $\chi^2$ statistic, which means you shouldn't trust the computed p-value. You might find it more fruitful to ponder what independence of thousands of rows actually means and what you would learn from testing it. (I'm curious about what your answer might be.) $\endgroup$ – whuber Sep 17 '15 at 5:06
  • $\begingroup$ The last couple of sentences in whuber's comment is probably the most useful/ to the point thing one might say. I expect that either one of your columns or (more likely) some of your rows have a small total. What are your two column totals? What proportion of your row totals are <5? <1? $\endgroup$ – Glen_b Sep 17 '15 at 5:24
  • $\begingroup$ I made sure that all the frequencies are > 5 $\endgroup$ – PTDS Sep 17 '15 at 13:08
  • $\begingroup$ I am trying to characterize the browsing behavior of several people. The rows are different websites (hence there are thousands of them) and the two columns are two conditions when those sites were visited (e.g., when the people are traveling vs when they are not traveling). The cell values are the frequencies of visit to the websites. $\endgroup$ – PTDS Sep 17 '15 at 13:14
  • $\begingroup$ My objective is to see if the browsing behavior is different under these two conditions. Am I following the correct approach? $\endgroup$ – PTDS Sep 17 '15 at 13:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.