Chi-square test in SPSS

Before you write that there is a relationship between gender and preferred programme type, or between qualification and attitudes towards e-learning, your supervisor or examiner will ask: which test did you use with nominal variables that have no mean? In most theses the answer is the chi-square test, which checks whether the distribution of frequencies in the table differs from what we would expect if there were no relationship. In this guide we explain when to use the chi-square test and what its assumptions are, how to run it in SPSS through Crosstabs, how to read the tables, Cramér's V and the adjusted residuals, what to do if the expected-frequency assumption is not met, and how to report the result in Chapter Four.

What Is the Chi-Square Test?

The chi-square test is a non-parametric test that compares the observed frequencies in each cell with the expected frequencies if the null hypothesis were true. If the difference between them is too large to be explained by chance, the test value is large and the p-value is small.

The test has two common uses in theses:

  • Test of independence: examines the relationship between two nominal or categorical variables, such as gender and preferred training mode. It is the focus of most of this guide.
  • Goodness-of-fit test: examines a single variable: are the responses distributed across its categories in the proportions we expect, such as equally across three options?

In a test of independence, the expected frequency of any cell equals the row total multiplied by the column total, divided by the sample size. In our example below, the expected frequency for men who prefer in-person training is (50 × 40) / 120 = 16.67, while the observed frequency was 24. This difference, together with the differences in the other cells, is what the test combines into a single value.

When Should You Use the Chi-Square Test in Your Thesis?

Use it when both variables are categorical and you want to know whether one is related to the other. Common examples in education, management and nursing theses:

  • Is gender related to the preferred training mode (in-person, online, blended)?
  • Does attitude towards a new system (supportive, neutral, opposed) differ by academic qualification?
  • Is a specific complication related to the type of treatment the patient received?

If one of the variables is quantitative, such as a total job satisfaction score, the chi-square test is not the right choice, because turning scores into categories loses part of the information. In that case a t-test, an analysis of variance or their non-parametric alternatives are usually more suitable. To compare all the options, see guide to choosing the right statistical test.

Assumptions of the Chi-Square Test

The test does not assume a normal distribution, but it has assumptions you need to check before interpreting the result:

  1. Independence of observations: each participant appears in one cell only. So the test is not suitable for pre- and post-measurements on the same people, or for multiple-response questions where a participant chooses more than one answer.
  2. Mutually exclusive categories: each case belongs to only one category of each variable.
  3. Counts, not proportions: the test is applied to numbers of cases, not to percentages or means.
  4. Size of expected frequencies: the widely used rule, attributed to Cochran (1954), is that no more than 20% of cells should have expected frequencies below 5, and no cell should be below 1. This is a practical rule, not a law, and some sources relax it for larger tables, but it is the standard most supervisors ask for.

Below the Chi-Square Tests table, SPSS shows a note such as “0 cells (0.0%) have expected count less than 5”, from which you can read the fourth assumption directly.

Worked Example: Is Gender Related to Preferred Training Mode?

We apply the steps to a hypothetical teaching data file: 120 teachers (50 men and 70 women) who answered the question: which mode of professional training do you prefer? (in-person, online, blended). All figures are calculated from this file.

The two hypotheses in statistical form:

  • The null hypothesis (H₀): there is no relationship between gender and preferred training mode; that is, the two variables are independent.
  • The alternative hypothesis (H₁): there is a relationship between gender and preferred training mode.

For how to write the two hypotheses in your thesis, see formulating null and alternative hypotheses.

Steps for the Chi-Square Test in SPSS

A note on the screenshots: the images in this guide are screenshots from the free program PSPP, which opens SPSS files and uses almost the same menus and steps. PSPP shows some values with two decimal places, such as 11.04, while SPSS shows them with three, such as 11.045. The category names in the file are in English: Male and Female for gender, and In-person, Online and Blended for training mode.

  1. From the top menu, choose Analyze > Descriptive Statistics > Crosstabs.
    Crosstabs menu for the chi-square test
    Step 1: Analyze, then Descriptive Statistics, then Crosstabs. (Screenshot from the free program PSPP)
  2. Move the gender variable to the Rowsbox and the training mode variable to the Columnsbox. A convenient rule for reading the output is to put the variable whose groups you are comparing in the rows.
    Gender in Rows and training mode in Columns
    Step 2: gender in Rows and training_mode in Columns. (Screenshot from the free program PSPP)
  3. Click the Statistics, tick Chi-square andPhi and Cramer’s V, then click Continue.
    Ticking Chi-square and Phi and Cramer's V
    Step 3: ticking chi-square and Cramér's V. (Screenshot from the free program PSPP)
  4. Click the Cells, tick Observed andExpected and the Rowpercentages, and under Residuals , tick Adjusted standardized. Then click Continue andOkay.
    Cells options: expected counts, percentages and adjusted residuals
    Step 4: expected counts, row percentages and adjusted residuals. (Screenshot from the free program PSPP)

How to Read the Crosstabs Table

Start with the crosstabulation before the p-value, because it tells you the shape of the relationship. Read the percentages within each row (Row %), not the counts alone, because there are more women than men in the sample.

Crosstabulation of gender and preferred training mode
The crosstabulation: observed and expected counts, row percentages and adjusted residuals. (Screenshot from the free program PSPP)
  • In-person training: chosen by 48.0% of men compared with 22.9% of women.
  • Online training: chosen by 45.7% of women compared with 20.0% of men.
  • Blended training: the two percentages are close (32.0% for men and 31.4% for women).

Then look at the Expected row to check the fourth assumption: the smallest expected frequency in the table is 15.83, so no cell is below 5 and the assumption is met.

How to Read the Chi-Square Tests Table

Chi-Square Tests table
Chi-Square Tests table: a chi-square value of 11.04 with two degrees of freedom and Sig. = .004. (Screenshot from the free program PSPP)

Rely on the first row, Pearson Chi-Square, and read three values from it:

  • Value: the chi-square value, here 11.04.
  • df: the degrees of freedom, equal to (number of rows − 1) × (number of columns − 1), that is (2 − 1) × (3 − 1) = 2.
  • Asymptotic Sig.: the p-value, here .004, which is below 0.05, so we reject the null hypothesis and conclude that there is a statistically significant relationship between gender and preferred training mode.

The other rows have specific uses. The Likelihood Ratio row is a close alternative to Pearson's, and its result here is similar (11.33, p = .003). The Linear-by-Linear Association row assumes that the categories are ordered, so it has no meaning with nominal variables such as gender and training mode; ignore it here. In 2 × 2 tables SPSS adds two more rows: Continuity Correction (Yates' correction) andFisher’s Exact Test.

Remember that rejecting the null hypothesis means the two variables are associated, not that gender causes a preference for a particular mode. The chi-square test does not establish causation.

Effect Size: Cramér's V

The p-value tells you whether the relationship is significant, but not how strong it is, because it is affected by sample size. So always report the effect size with the result.

Symmetric Measures table and Cramér's V
Symmetric Measures table: Cramér's V = .30. (Screenshot from the free program PSPP)

In our example Cramér's V was .30; in a table with two rows it equals the phi coefficient. How to interpret it depends on the smaller of (number of rows − 1) and (number of columns − 1). In our table this value is 1, so Cohen's (1988) widely used benchmarks apply: .10 small,.30 medium and.50 large. The effect size in our example is therefore medium. In larger tables, such as 3 × 4, the thresholds are lower, so refer to the appropriate table in the source.

Where Is the Relationship? Adjusted Residuals

A significant test tells you there is a relationship, but not which cells are responsible for it. Adjusted standardized residuals help with this: if a residual's absolute value exceeds 1.96, that cell differs from what was expected at the 0.05 level. Because you are examining several cells at once, many researchers prefer a stricter threshold using a Bonferroni correction, as Sharpe (2015) suggests. Our table has six cells, so the significance level becomes 0.05 / 6 ≈ 0.0083, and the corresponding threshold is about 2.64.

Continuing with the same example: the adjusted residual is 2.88 for men in in-person training and 2.91 for women in online training, and both exceed both thresholds. In other words, men preferred in-person training more than expected, and women preferred online training more than expected. For blended training the residual is .07, so men and women do not differ in preferring it. Note that in a table with two rows the residuals are symmetrical with opposite signs, so the corresponding cell for women in in-person training is −2.88.

The Chi-Square Goodness-of-Fit Test

If your question is about a single variable, for example: are teachers spread equally across the three training modes? Use the goodness-of-fit test from Analyze > Nonparametric Tests > Legacy Dialogs > Chi-square. Move the variable to the Test Variable List, and keep All categories equal if the expected proportions are equal, or enter the expected proportions under Values if you have specific proportions from a previous study or official statistics.

In the same file, 40 teachers chose in-person training, 42 online and 38 blended, with 40 expected for each mode. The result was χ²(2, N = 120) = 0.20, p = .905, so there is no evidence that the three modes differ in how many people prefer them. This result comes from the NPAR TESTS command in PSPP on the same file.

What to Do If the Expected-Frequency Assumption Is Not Met

If the SPSS note shows that more than 20% of cells have an expected count below 5, you have several options depending on your data:

  1. Merge categories on theoretical grounds: for example, merge "disagree" and "strongly disagree" into one category, or merge higher qualifications into a "postgraduate" category. The merge must make sense for your research question, and you should report it and the reason for it in your thesis.
  2. Fisher's exact test: SPSS shows it automatically for 2 × 2 tables. For larger tables it requires the Exactbutton, which is available if your version of SPSS includes the Exact Tests module.
  3. Removing an almost empty category: if a category contains hardly any cases, such as "other", it can be excluded provided you state this clearly and the exclusion does not change the meaning of the question.

Do not change the categories after seeing the result in order to make it significant. Decide how to merge before the analysis, and report it as it is.

Not sure which test to use? Try the free wizard

Answer short questions about your study aim and your data, and the wizard suggests a suitable test, where to find it in SPSS and its assumptions, with a ready methods paragraph.

Open the Test Chooser

How to Report the Chi-Square Test Result in Chapter Four

Present the crosstabulation with counts and row percentages, then write a paragraph stating the test, the chi-square value, degrees of freedom and sample size, the p-value, the effect size, and then the direction of the relationship. In APA style, statistical symbols are italicised and p is written without a zero before the decimal point.

Example from the hypothetical teaching file:

A chi-square test of independence was conducted to examine the relationship between gender and preferred mode of professional training among 120 teachers, and all expected frequencies were greater than 5. The results showed a statistically significant relationship between the two variables, χ²(2, N = 120) = 11.04, p = .004, with a medium effect size (Cramér’s V = .30). The adjusted residuals indicated that men preferred in-person training more than expected (48.0% compared with 22.9% of women), whereas women preferred online training more than expected (45.7% compared with 20.0% of men), and men and women did not differ in their preference for blended training.

If the result is not significant, write: "No statistically significant relationship was found between…", with the same values. Do not write that the two variables are "completely independent", because failing to reject the null hypothesis does not prove it.

Common Mistakes in the Chi-Square Test

  • Entering percentages instead of counts: the test is calculated on numbers of cases, and percentages give a wrong result.
  • A participant appearing in more than one cell: as in multiple-response questions or pre- and post-measurements. For pre- and post-measurements of a binary variable on the same people, use McNemar's test instead.
  • Ignoring the expected-frequency assumption: read the SPSS note below the table before interpreting the p-value.
  • Reading the Linear-by-Linear row with nominal variables: this row applies only to ordered categories. Rely on the Pearson Chi-Square row.
  • Reporting only the p-value: report Cramér's V, and explain the direction of the relationship from the percentages and adjusted residuals.
  • Interpreting the relationship as causal: write "is related to" or "there is a relationship", not "leads to" or "causes".
  • Turning a quantitative variable into categories without justification: if you have a total score, analyse it as it is with a test suited to quantitative variables.

Do you need help analyzing your research data?

The Science Club Academy team helps you prepare your data, analyze it, and interpret the results for master’s theses, doctoral dissertations, and research papers. Learn more about our Integrated statistical analysis service, and the consultation is free.

Send your data details via WhatsApp

Frequently Asked Questions

Is the chi-square test the same as the "squared chi" test?

Yes. In Arabic the two names are translations of the same term (chi-square), and its symbol is χ². You may also find it written as "Ka²" in some Arabic theses.

When should I use Fisher's exact test instead of chi-square?

When the table is 2 × 2 and has an expected frequency below 5, or when the sample is very small. SPSS shows its result automatically for 2 × 2 tables, so rely on it in that case and state the reason.

Is chi-square suitable for Likert scale items?

It is suitable for examining the relationship between a single item and a nominal variable, such as the distribution of "agree, neutral, disagree" responses by gender, but it ignores the order of the categories. If your question is whether one group tends to give higher ratings, the Mann-Whitney test makes use of the order. The total score of the scale is usually treated as a quantitative variable.

My result is not significant. Has my research failed?

No. The absence of a significant relationship is a scientific result that is reported and discussed like any other. Report the full values, discuss possible reasons such as sample size or the nature of the population, and compare it with previous studies.

Conclusion

Use the chi-square test when both variables are categorical and each participant is in one cell. Before reading the p-value, check the expected frequencies, then read the Pearson Chi-Square row, report Cramér's V, and identify the direction of the relationship from the row percentages and adjusted residuals. If the expected-frequency assumption is not met, merge categories on theoretical grounds or use Fisher's exact test. To make sure you choose the right test for your other hypotheses, see also the normality test in SPSS andThe difference between parametric and nonparametric tests.

References

  • Cochran, W. G. (1954). Some methods for strengthening the common χ² tests. Biometrics, 10(4), 417–451. https://doi.org/10.2307/3001616
  • Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Lawrence Erlbaum Associates.
  • Field, A. (2018). Discovering statistics using IBM SPSS Statistics (5th ed.). SAGE.
  • McHugh, M. L. (2013). The chi-square test of independence. Biochemia Medica, 23(2), 143–149. https://doi.org/10.11613/BM.2013.018
  • Sharpe, D. (2015). Chi-square test is statistically significant: Now what? Practical Assessment, Research, and Evaluation, 20, Article 8. https://doi.org/10.7275/tbfa-x148

Mr. Mohamed AbdelfattahAuthor posts

Avatar for Mr. Mohamed Abdelfattah

Mr. Mohamed Abdelfattah holds a master's degree in statistics from the Institute of Statistics. At Science Club Academy, he writes about statistical tests, SPSS, and how they are applied in master's and PhD theses.

No comment

Leave a Reply

Your email address will not be published. Required fields are marked *