#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

# How to set the number of categorical variables of a chi-sq test in JASP

I'm doing a chi-sq of independence in JASP with nominal variables on the vertical axis and ordinal variables on the horizontal axis. It has interpreted all of it as nominal, so that might contribute to my problem, but I think not.

The data is collected from a survey and the participants were given 4 options, as illustrated in table 1. For the first question, all options were selected by one or more respondents, so the contingency table looks good and I believe the data was analysed correctly.

However, in the next question only 2 of the 4 options were selected by all participants, and so 2 were selected by none. The contingency table produced doesn't even display the options that were not selected, and so I worry that the test was run incorrectly and the result is skewed data. How can I let JASP now that there should be a total of 4 options on the horizontal axis?

• I'm on version 0.17.3

• I'm pretty sure that's the way Chi Square contingency is supposed to work.

For each cell, the expected count = (row_total * column_total) / grand total. Thus, the expected count will be zero if either the row total or the column total is zero. However, an expected count is not permitted to be zero since the expected count is also a denominator in the general expression for computing Chi Square:

Chi Sq = Sum_for_Each_Cell [ (Observed_Count - Expected_Count]^2) / Expected_Count ]

Consequently, it's not possible to compute Chi Square if a row total or a column total is zero.

R

• Correction:

Chi Sq =

Sum_for_Each_Cell [

((Observed_Count - Expected_Count)^2) / Expected_Count ]

R