After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 621227 - Chi Squared Test for independence.
Chi Squared Test for independence.
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Analytics
1.10.x
Other Windows
: Normal normal
: ---
Assigned To: Morten Welinder
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-06-10 17:25 UTC by Matt Haner
Modified: 2010-06-10 19:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test case for the issue (3.31 KB, application/x-gnumeric)
2010-06-10 17:26 UTC, Matt Haner
Details

Description Matt Haner 2010-06-10 17:25:35 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?  ;-)
Comment 1 Matt Haner 2010-06-10 17:26:31 UTC
Created attachment 163308 [details]
Test case for the issue
Comment 2 Andreas J. Guelzow 2010-06-10 19:20:30 UTC
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)))