Skip to Main Content

Analyze Data: SPSS

Chi-Square Test of Independence

The Chi-Square Test is used to test whether two categorical (nominal) variables are associated with each other. This test assumes that the observations are independent, and that the expected frequencies for each category should be at least 1 (NOTE: no more than 20% of the categories should have expected frequencies less than 5). 

Note that this is a non-parametric test. There is no parametric version of a Chi-Square Test of Independence.

How to run a Chi-square for a crosstabs

  1. Click on Analyze. Select Descriptive Statistics. Select Crosstabs. 
  2. Place one or more variables in “Row(s)” and one or more variables in “Column(s)”.
    • NOTE: SPSS will generate a crosstab table for each row / column combination, as only one row and one column is used per crosstab.
  3. To run a Chi-Square test, click Statistics and check the “Chi-square” box. If you want a measure of effect size, also check the “Phi and Cramer’s V” box. Click Continue to save your choices. 
  4. Click Cells to ensure the “Observed” box is checked. Optionally, you can request the expected number of cases here if you check the “Expected” box. Click Continue to save your choices.
  5. Click OK to run the test (results will appear in the output window).A screenshot of the SPSS software showing the "Crosstabs" pop-up box overlaid on the Data View interface.

Interpreting the Output

Running the above steps will generate the following output: a crosstab table between the variables you selected (e.g., indicating how many of each combination was present in your data), a Chi-Square Tests table that tells you whether your categorical variables are independent (p > .05) or associated (p < .05), and a Symmetric Measures table that tells you the effect size of the test.

For the Chi-Square Tests table, we generally read the “Pearson Chi-Square” row. The “Value” column tells you your Chi-square (X2) value, and the “Asymptotic Significance (2-sided) column tells you your p-value (p < .05 is generally considered statistically significant, which would indicate that the variables are associated). A screenshot of the SPSS output from the "Crosstabs" procedure, showing a contingency table of gender x favourite colour and also a Chi-Square Test table.

Spearman's Rank-Order Correlation

Spearman’s rank-order correlation is used to determine the strength and direction of a relationship of the rankings of two variables. The variables can be ordinal or continuous. This test does not assume the variables are normally distributed. However, the relationship between the ranked values should be monotonic (i.e., an increasing OR decreasing relationship; not increasing AND decreasing).

Note that this is a non-parametric test; you could / should use a Spearman’s rank-order correlation if the normality assumption has been violated for your Pearson correlation (i.e., the parametric equivalent). You can also use this test if you wish to conduct a correlation on ordinal data (note: Pearson’s would not be appropriate here).

How to run a Spearman correlation

  1. Click on Analyze. Select Correlate. Select Bivariate.
  2. Place two or more variables in the “Variables” box.
  3. In the Correlation Coefficients section, ensure “Spearman” is checked.
  4. Click OK to run the test (results will appear in the output window).

A screenshot of the SPSS software showing the "Bivariate Correlations" pop-up box overlaid on the Data View interface. "Spearman" is selected as the correlation coefficient.

Interpreting the Output

Running the above steps will generate the following output: a Correlations table that indicates the Spearman correlation (rho) between the variables, the significance value (p), and the number of observations (n).

Spearman’s rho can range from -1 (perfect negative) to +1 (perfect positive), and indicates the strength and direction of the relationship of the rankings of the two variables; p indicates statistical significance, with < .05 generally considered statistically significant (i.e., indicating a significant correlation between the rankings of the two variables). Here, we see a non-significant weak positive correlation between the two continuous variables.

A screenshot of the SPSS output from the Spearman correlation procedure, showing the correlation (rho = .019) and significance level (p = .921).

Wilcoxon signed-rank test

The Wilcoxon signed-rank test is used to determine whether the median of a single continuous variable differs from a specified constant (similar to a one-sample t-test) AND / OR whether the median of two continuous variables from the same group of participants differ (similar to a paired-samples t-test). Both versions of this test do not assume that the data are normally distributed.

Note that this is a non-parametric test; you could / should use the Wilcoxon signed-rank test if the normality assumption has been violated for your one-sample t-test or a paired-samples t-test (i.e., the parametric equivalents). 

How to run a Wilcoxon signed-rank test (ONE SAMPLE T-TEST VERSION)

  1. Click on Analyze. Select Nonparametric Tests. Select One Sample. 
  2. In the “Objective” tab on the dialogue box, click the “Customize analysis” circle.

A screenshot of the SPSS software showing the "One Sample Nonparametric Tests" pop-up box overlaid on the Data View interface.  The "customize analysis" button has been selected on the "Objective" tab.

  1. In the “Fields” tab on the dialogue box, select the single column of data you wish to use for the Wilcoxon one-sample test and move it to the “Test Fields” box.

A screenshot of the SPSS software showing the "One Sample Nonparametric Tests" pop-up box.

  1. In the “Settings” tab on the dialogue box, click the “Customize tests” circle, then check the “Compare median to hypothesized (Wilcoxon signed-rank test)” box. Input the constant you wish to use in the “Hypothesized median” input box.

A screenshot of the SPSS software showing the "One Sample Nonparametric Tests" pop-up box.

  1. Click Run to run the test (results will appear in the output window).

Interpreting the Output (ONE SAMPLE T-TEST VERSION)

Running the above steps will generate the following output: a Hypothesis Test Summary table and a One-Sample Wilcoxon Signed Rank Test Summary table that indicate the results of the test (p < .05 is generally considered statistically significant, which would indicate that the variable median differs from the test value), and a One-Sample Wilcoxon Signed Rank Test histogram that shows the frequency values of the selected column of data with the observed median overlaid on top.

A screenshot of the SPSS output from the Wilcoxon signed-rank test (here, the one-sample version), showing the hypothesis test summary table with the conclusion reject the hypothesis, and a histogram of the observed frequencies in the fake data.

How to run a Wilcoxon signed-rank test (PAIRED SAMPLES T-TEST VERSION)

  1. Click on Analyze. Select Nonparametric Tests. Select Related Samples.
  2. In the “Objective” tab on the dialogue box, click the “Customize analysis” circle.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box overlaid on the Data View interface.  The "customize analysis" button has been selected on the "Objective" tab.

  1. In the “Fields” tab on the dialogue box, select the two columns of data you would like to use for the Wilcoxon paired-samples test and move them to the “Test Fields” box.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box.  Two columns of data have been moved to the "Test Fields" section on the "Fields" tab.

  1. In the “Settings” tab on the dialogue box, click the “Customize tests” circle, then in the  “Compare Median Difference to Hypothesized” section, check the “Wilcoxon matched-pair signed-rank (2 samples)” box. 

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box.  The "Customize tests" option has been selected on the "Settings" tab. The "Wilcoxon matched-pair signed-rank (2 samples)" checkbox has been selected.

  1. Click Run to run the test (results will appear in the output window).

Interpreting the Output (PAIRED SAMPLES T-TEST VERSION)

Running the above steps will generate the following output: a Hypothesis Test Summary table and a Related-Samples Wilcoxon Signed Rank Test Summary table that indicate the results of the test (p < .05 is generally considered statistically significant, which would indicate that the medians of the two samples of the single group differed), and a Related-Samples Wilcoxon Signed Rank Test histogram that shows the frequency of the rankings (displayed as difference scores between the two samples of the single group). In this example, there are only positive difference scores / rankings because the data were created so that one column of data had higher values than the other column.

A screenshot of the SPSS output from the Wilcoxon signed-rank test (here, the paired-sample version), showing the hypothesis test summary table with the conclusion reject the hypothesis, and a histogram of the observed frequencies in the fake data (here, difference scores between the two datapoints for each participant).

Mann-Whitney U test

The Mann-Whitney U test is used to determine whether two groups’ medians on the same continuous variable differ (similar to an independent samples t-test). This test does not assume that the data are normally distributed, but is does assume that the distributions are the same shape.

Note that this is a non-parametric test; you could / should use the Mann-Whitney U test if the normality assumption has been violated for your independent samples t-test (i.e., the parametric equivalent).

How to run a Mann-Whitney U test

  1. Click on Analyze. Select Nonparametric Tests. Select Independent Samples.
  2. In the “Objective” tab on the dialogue box, click the “Customize analysis” circle.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Independent Samples" pop-up box overlaid on the Data View interface.  The "customize analysis" button has been selected on the "Objective" tab.

  1. In the “Fields” tab on the dialogue box, select the single column of continuous data you wish to use for the Mann-Whitney independent samples test and move it to the “Test Fields” box. Select the single categorical grouping variable (which must be only two groups) you wish to use and move it to the “Groups” box.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Independent Samples" pop-up box.  Two columns of data have been moved in the "Fields" tab: A continuous column of data to the "Test Fields" section and a categorical column of data to the "Groups" section.

  1. In the “Settings” tab on the dialogue box, click the “Customize tests” circle, then in the “Compare Distributions across Groups” section, check the “Mann-Whitney U (2 samples)” box.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box.  The "Customize tests" option has been selected on the "Settings" tab. The "Mann-Whitney U (2 samples)" checkbox has been selected.

  1. Click Run to run the test (results will appear in the output window).

Interpreting the Output

Running the above steps will generate the following output: a Hypothesis Test Summary table and an Independent-Samples Mann-Whitney U Test Summary table that indicate the results of the test (p < .05 is generally considered statistically significant, which would indicate that the medians of the two groups differ), and an Independent-Samples Mann-Whitney U Test histogram that shows the observed frequencies in the fake data (here, the histogram for females in on the left and the histogram for males is on the right).

A screenshot of the SPSS output from the Mann-Whitney U Test, showing the hypothesis test summary table with the conclusion retain the hypothesis, and a histogram of the observed frequencies in the fake data (here, the histogram for females in on the left and the histogram for males is on the right).

Kruskal-Wallis H test

The Kruskal-Wallis H test is used to determine whether three or more groups’ medians on the same continuous variable differ (similar to a one-way ANOVA, with independent groups). This test does not assume that the data are normally distributed, but it does assume the distributions are the same shape.

Note that this is a non-parametric test; you could / should use the Kruskal-Wallis H test if the normality assumption has been violated for your one-way ANOVA with independent groups (i.e., the parametric equivalent).

How to run a Kruskal-Wallis H test

  1. Click on Analyze. Select Nonparametric Tests. Select Independent Samples.
  2. In the “Objective” tab on the dialogue box, click the “Customize analysis” circle.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Independent Samples" pop-up box overlaid on the Data View interface.  The "customize analysis" button has been selected on the "Objective" tab.

  1. In the “Fields” tab on the dialogue box, select the single column of continuous data you wish to use for the Kruskal-Wallis H test and move it to the “Test Fields” box. Select the single categorical grouping variable (which must be three or more groups) you wish to use and move it to the “Groups” box.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Independent Samples" pop-up box.  Two columns of data have been moved in the "Fields" tab: A continuous column of data to the "Test Fields" section and a categorical column of data to the "Groups" section.

  1. In the “Settings” tab on the dialogue box, click the “Customize tests” circle, then in the “Compare Distributions across Groups” section, check the “Kruskal-Wallis 1-way ANOVA (k samples)” box. Indicate whether you would like either “all pairwise” or “stepwise step-down” for your multiple comparisons.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box.  The "Customize tests" option has been selected on the "Settings" tab. The "Kruskal-Wallis 1-way ANOVA (k samples)" checkbox has been selected.

  1. Click Run to run the test (results will appear in the output window).

Interpreting the Output

Running the above steps will generate the following output: a Hypothesis Test Summary table and an Independent-Samples Kruskal-Wallis Test Summary table that indicate the results of the test (p < .05 is generally considered statistically significant, which would indicate that the medians of the k groups differ but does NOT indicate where this difference is), an Independent-Samples Kruskal-Wallis Test boxplot of the different categorical groups' values on the continuous variable, and a Pairwise Comparisons table that indicates which (if any) of the groups are different from one another (if p < .05, the two groups are statistically significantly different).

A screenshot of the SPSS output from the Kruskal-Wallis H Test, showing the hypothesis test summary table with the conclusion retain the null hypothesis, and a boxplot of the different categorical groups' values on the continuous variable. The pairwise comparisons of the groups are shown in a table.

 

Friedman test

The Friedman test is used to determine whether one groups’ ranking on three or more continuous or ordinal variables differ (similar to a repeated measures one-way ANOVA). This test does not assume that the data are normally distributed, but it does assume the distributions are the same shape.

Note that this is a non-parametric test; you could / should use the Friedman test if the normality assumption has been violated for your repeated measures one-way ANOVA (i.e., the parametric equivalent).

How to run a Friedman test

  1. Click on Analyze. Select Nonparametric Tests. Select Related Samples.
  2. In the “Objective” tab on the dialogue box, click the “Customize analysis” circle.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box overlaid on the Data View interface.  The "customize analysis" button has been selected on the "Objective" tab.

  1. In the “Fields” tab on the dialogue box, select the three (or more) columns of continuous or ordinal data you would like to use for the Friedman’s test and move them to the “Test Fields” box.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box.  Three columns of data have been moved to the "Test Fields" section on the "Fields" tab.

  1. In the “Settings” tab on the dialogue box, click the “Customize tests” circle, then in the “Compare Distributions” section, check the “Friedman’s 2-way ANOVA by ranks (k samples)” box. Indicate whether you would like “none”, “all pairwise”, or “stepwise step-down” for your multiple comparisons.

A screenshot of the SPSS software showing the "Nonparametric Tests: Two or More Related Samples" pop-up box.  The "Customize tests" option has been selected on the "Settings" tab. The "Friedman's 2-way ANOVA by ranks (k samples)" checkbox has been selected.

  1. Click Run to run the test (results will appear in the output window).

Interpreting the Output

Running the above steps will generate the following output: a Hypothesis Test Summary table and a Related-Samples Friedman’s Two-Way Analysis of Variance by Ranks Summary table that indicate the results of the test (p < .05 is generally considered statistically significant, which would indicate that the rankings between the three of more conditions differed but does NOT indicate where this difference is), a Related-Samples Friedman’s Two-Way Analysis of Variance by Ranks graph that shows the frequency of the rankings in each condition. In this example, the ranks are all “1”, “2”, and “3” as the data were created so that the different columns of data were distinct (i.e., did not overlap at all), and a Pairwise Comparisons table that indicates which (if any) of the conditions are different from one another (if p < .05, the two conditions are statistically significantly different).

A screenshot of the SPSS output from the Wilcoxon signed-rank test (here, the paired-sample version), showing the hypothesis test summary table with the conclusion reject the hypothesis, and a histogram of the observed frequencies in the fake data (here, difference scores between the two datapoints for each participant).

Suggest an edit to this guide

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.