GNOME Bugzilla – Bug 621227
Chi Squared Test for independence.
Last modified: 2010-06-10 19:20:30 UTC
There is a general failure for contingency tables that are not square. I suspect somewhere in the code someone got a number of rows or number of columns backward. I have checked the results for up to a 4x4 table and these generally seem correct. Attached is a copy of the problem. Probably not the place for fanmail, but you guys ROCK! Thanks for the outstanding piece of software. Do you guys have t-shirts for bug finders? ;-)
Created attachment 163308 [details] Test case for the issue
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report. If you are interested in what was wrong: In the formula we create a vector of ones. That vector was sized based on the length of a row. Of course that isn't correct for non-square matrices and so we need two of such vectors, one for the rows and one for the columns. That's what transpose(column(offset(TestingByHand!$A$1:$C$5,1,1,4,2))/column(offset(TestingByHand!$A$1:$C$5,1,1,4,2))) and transpose(row(offset(TestingByHand!$A$1:$C$5,1,1,4,2))/row(offset(TestingByHand!$A$1:$C$5,1,1,4,2))) is about. Essentially we had to change row(offset(TestingByHand!$A$1:$C$5,1,1,4,2))/row(offset(TestingByHand!$A$1:$C$5,1,1,4,2)) into transpose(column(offset(TestingByHand!$A$1:$C$5,1,1,4,2))/column(offset(TestingByHand!$A$1:$C$5,1,1,4,2)))