Chi-square test not working because of missing values
Posted: Thu Feb 05, 2026 1:58 pm
Dear all,
Chi-square test for goodness-of-fit and test of independence are not working because of missing values that remain included in the calculations.
I have put the missing values in "missing values" in every variable, and they have been greyed out in the data set. However, they still remain in the variable levels. I have not found any way to exclude them from the calculations for Chi-square tests which of course did not work.
Indeed when I do the analysis and in the left box I tick "expected quantities", I can see that they have been taken into account (let's say they represent 20% of the answers) and on the right, in the result box, they don't appear but have been taken into consideration, meaning the other groups represent 80% (instead of 100%) and one part of the calcuation is "divided by nothing" (the 20% of the missing values), which result in NaN...
Anyone could please help me on that? That would be very much appreciated as otherwise I need to change software and restart from scratch all my analysis
Many thanks
Chi-square test for goodness-of-fit and test of independence are not working because of missing values that remain included in the calculations.
I have put the missing values in "missing values" in every variable, and they have been greyed out in the data set. However, they still remain in the variable levels. I have not found any way to exclude them from the calculations for Chi-square tests which of course did not work.
Indeed when I do the analysis and in the left box I tick "expected quantities", I can see that they have been taken into account (let's say they represent 20% of the answers) and on the right, in the result box, they don't appear but have been taken into consideration, meaning the other groups represent 80% (instead of 100%) and one part of the calcuation is "divided by nothing" (the 20% of the missing values), which result in NaN...
Anyone could please help me on that? That would be very much appreciated as otherwise I need to change software and restart from scratch all my analysis
Many thanks