Zero columns/rows in chi-square test I work with CHAID method, which is based on Chi-square test of independence. All my independent variables are numerical, so I convert them into ordinal via intervals. I have to adjacent categories (2 rows, 3 columns) with values:
5 0 4
6 0 6

As for me, I cannot use Chi-square here, because expected value of 2nd column is 0 and we mustn't divide on zero!
But some resources gives strange value for such case. E.g. statistics for those values = 0.969.

*

*Any ideas how was it calculated?


*What's the rules of merging categories with zeros in CHAID? E.g, for this 8x3 table?
 50 0   0  
 0  0   0  
 0  0   3  
 0  0   8  
 0  1   25  
 0  15  14  
 0  18  0  
 0  16  0  

 A: *

*How are that value calculated? By removing the all-zeros column, as that is totally uninformative (note that this is really changing the null hypothesis, as the original null hypothesis including the unobserved level cannot be tested). Using that page I do not get the value you quote, but the same value as the following R call:

chisq.test(matrix(c(5, 6, 4, 6), 2, 2), correct=FALSE)

    Pearson's Chi-squared test

data:  matrix(c(5, 6, 4, 6), 2, 2)
X-squared = 0.063636, df = 1, p-value = 0.8008

Warning message:
In chisq.test(matrix(c(5, 6, 4, 6), 2, 2), correct = FALSE) :
  Chi-squared approximation may be incorrect



*Rows/columns with zero sum should be removed. For your example, that removes row 2, but leaves a lot of zeros. For a proper treatment you must tell us if those are sampling or structural zeros, but avoiding that question and just removing row 2, here is what R tells us:

tab
     [,1] [,2] [,3]
[1,]   50    0    0
[2,]    0    0    3
[3,]    0    0    8
[4,]    0    1   25
[5,]    0   15   14
[6,]    0   18    0
[7,]    0   16    0
> chisq.test(tab)

    Pearson's Chi-squared test

data:  tab
X-squared = 250.78, df = 12, p-value < 2.2e-16

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

but we can call it again, now asking it to simulate the p-value (which in effect uses a version of the Fisher exact test)
 chisq.test(tab, sim=TRUE, B=20000)

    Pearson's Chi-squared test with simulated p-value (based on 20000
    replicates)

data:  tab
X-squared = 250.78, df = NA, p-value = 5e-05
```  

