iSixSigma

negative contingency matrix entries for chi square?

Six Sigma – iSixSigma Forums Old Forums General negative contingency matrix entries for chi square?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #37720

    Mario
    Participant

    Can the values in the contingency matrix for chi square be negative including zeroes? My range of values is [-1,1]. Some expected values come out 0, and divisions cannot be performed.
    Greetings,
    Mario

    0
    #111573

    Mikel
    Member

    Yes.

    0
    #111578

    Nanni
    Participant

    If you call contingency matrix to contengency table, and the values that you are asking are the value’s of the factors, then it’s ok your range and the answer is YES. 
    The variables (X and Y) of the contingency table are non-metrics.
     
    But if you refer to the frecuencies, the answer of your question is NO.
    Remember one assumption of contengency table is: More than about 20 percent of the cells have expected frequencies more than 4 and any cell have an expected frequency more than 0.
     
    Regards,
    Nanni

    0
    #111580

    Mario
    Participant

    How are Ei=0 values handeled in x^2 = (Oi-E-)^2/Ei?
    Mario

    0
    #111582

    Mario
    Participant

    Maybe then I am applying chi sqaure to the wrong problem?  I have a matrix populated with values in [-1,1].  I want to find out if the rows and columns are stochastically independent.
    Greetings,Mario

    0
    #111583

    Mikel
    Member

    You have a point if the expected value is 0.
    Code your data by adding 1 to all cells. The contingency table will be valid.

    0
    #111585

    Nanni
    Participant

    Sorry, but I don’t get it.
    Have you a matrix with -1 and 1 ??? Mmm… and you need to know  if the rows and columns are stochastically independent… ok, let me think…
    First, you have to declare wich are your populations.
    Second, define the possible values (in this case maybe would be -1 and 1)
    Third, count… what many -1’s and 1’s do you have for any populations.
    4th, do the contengency table. With the information that you gave us, I will see a table like this:
                                                      -1                    1
                             Rows            Oij = O11            O12
                             Columns            O21                 O22
    5th, Determine the expected frequency.
    6th, Compute the value of X^2
    7th, Determine the associated probability under Ho with Chi-Square with df = (r-1)(k-1). If that probability is equal to or less than alpha, reject Ho in favor of Ha.

    0
    #111589

    Mario
    Participant

    Consider for example the following 4×4 matrix where the values are reals from the range [-1,1]:
    0 .5 .3 .3
    1 -1 -1 0
    0 -1 1 1
    -1 0 0 0
    I would like to know if the rows and columns are independent, and more generally if the distribution of these values is from a particular expected distribution. There are no populations and frequencies here, as you would expect in a normal problem, just a matrix of numbers and a question of independence and goodness of fit to a particular expected distribution.
    Greetings, Mario

    0
    #111590

    Mario
    Participant

    Yes, I think that is better.  In that case my range of real values is shifted from [-1,1] to [0,2], so there are no negative values in the matrix, but the distances between the matrix values are preserved. I might still get 0 for Ei because the matrix might be all 0’s. So mabye I should add 2 to every cell and get the [1,3] range instead…
    Greetings, Mario 

    0
    #111592

    Mario
    Participant

    Actually adding a constant to every cell fixes the problems of expected frequencies less than 1, and 20% expected frequencies less than 5.  The problem however is that depending on which constant you add to every cell, the chi-square value is different…

    0
    #111593

    Nanni
    Participant

    How can u get -1 in expected frecuencie ??? It can NOT possible!

    0
    #111856

    Jonathon Andell
    Participant

    Good approach. You also may select other values instead of 1. Perhaps 0.1 will work in your case? There’s no single “correct” code value to select. But I think Stan knows that alrady…

    0
Viewing 12 posts - 1 through 12 (of 12 total)

The forum ‘General’ is closed to new topics and replies.