help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Chi2 test


From: Nicholas Jankowski
Subject: Re: Chi2 test
Date: Wed, 13 Feb 2019 17:35:02 -0500

(fyi, the convention is to trim text and bottompost on this help-list)

On Wed, Feb 13, 2019 at 4:58 PM Javier Garcia Falaguera <address@hidden> wrote:
Hi Nicholas,

Thanks for the support.

The expected result is something like:

pval_mu = something aprox to 0, but no 0.0
chisq_mu = a positive value
df_mu = 21 (not a value of interest);



running the same data, I get the following:

 pval_mu =  NaN
chisq_mu =  NaN
df_mu =  21


looking at the function (you can type  'edit chisquare_test_homogeneity' to open m-file functions and step through the code)

df is just the length of c, so df = 21

chisq gives NaN because the values used for d1 and c, and also d2 and c, produce a divide by zero error.  See the operations performed on lines 55, 58, and then 59.  

I don't know the chisquare test operation well enough to identify any errors in the code, but essectially the values of c are very small relative to the d1 and d2 values, producing zeros for the internal variables n_x and n_y. divide by (n_x+n_y) appears in the chisq calculation, so this obviously is a divide by zero error, or NaN.

I have access to a copy of matlab and it appears they do not have this function.  Can you point to some other implementation of the test that we can compare results?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]