Chi Square test for independence of 2 categorical variables


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

Need help in understanding why I am getting this issue or in what scenario
this issue may come? What is the work around for this if I need to establish
whether the 2 categorical variables are independent or not?




How much data points you have? Because generally Chi-square test requires at least 5 points in each category combination. If this condition is violated you get the error which you are getting here. So increasing data points would be one way or otherwise report the numbers with caution.


The chi-square approximation to the distribution of the test statistic relies on the counts being roughly normally distributed. If many of the expected counts are very small, the approximation may be poor.
The actual distribution of the chi-square statistic for independence in contingency tables is discrete, not continuous.
The warning is because one of the expected values in the chi-squared is less than 5.


Thanks for the suggestion…many of the cells have value/count as 0. Any workaround for this?