HP Forums
Issue with the Chi2TwoWay() function - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Issue with the Chi2TwoWay() function (/thread-14965.html)



Issue with the Chi2TwoWay() function - LT_learner - 05-10-2020 10:53 PM

The Chi2TwoWay() function does not duplicate all results from the χ2 test / 2-way test feature of the Inference App. This issue seems to occur only when the data set is not a square (nxn) matrix.

For example, try the data

75 10 15
40 30 10.

Loading the data into the ObsMat matrix (the App input data matrix) and running the App gives χ2 = 19.67 and P = 5.35E-5. Running Chi2TwoWay() will not produce the same numbers. I've tried several ways of inputting data: (1) ObsMat itself, (2) a copy of ObsMat saved to M1 and then using M1, (3) a matrix with the six numbers themselves. On both physical and virtual Prime, no attempts were successful in duplicating the App. Using the function gave calculator lock-ups, error messages or lists simply NOT duplicating χ2 and P. The function did not duplicate App results for any non-square ObsMat matrix I tried.

When data that fits in square matrices is used, the App and function results agree exactly regardless of the method is used to feed Chi2TwoWay() .

I’m using physical and virtual Primes with software version 2.1.14425 (2020 01 16).

Can someone explain this issue?


RE: Issue with the Chi2TwoWay() function - Helge Gabert - 05-12-2020 04:04 AM

It does appear that Chi2TwoWay() gives wrong results for non-square matrices. After testing a couple problems, running the app seems to return correct answers for square and non-square matrices alike.


RE: Issue with the Chi2TwoWay() function - LT_learner - 05-12-2020 05:14 PM

Thanks for looking into this, it is appreciated. We have the same conclusion.

Where do we go from here? A system software update or ???


RE: Issue with the Chi2TwoWay() function - Helge Gabert - 05-12-2020 09:14 PM

This is really a question for the HP development team.

From my experience, this will take a little while. In most cases, the fixed code eventually makes it into an update. But there is no guarantee of this happening. If Chi2TwoWay() is a CAS function (which it might be, I'm not sure), it will have to be fixed in Xcas first.


RE: Issue with the Chi2TwoWay() function - Tim Wessman - 05-13-2020 12:34 AM

No, it is in the non cas code. Very strange as the underlying routine is identical from memory...