Statistical tests: Categorical data

This page contains general information for choosing commonly used statistical tests. The examples linked provide general guidance which should be used alongside the conventions of your subject area. Where possible, a brief explanation of the test is given with links to performing this test using Excel, SPSS and R. It is worth noting that the examples often contain information about interpreting the output and results so can act as a guide to interpreting statistical results too.

To navigate this table, consider the following questions:

  • Is your outcome variable categorical?
  • How many samples (or groups) do you have?
  • Are the outcomes paired (or dependent)?

1 Sample

Chi-square goodness-of-fit

A nonparametric test designed to see if the sample follows a known distribution.

Example of Chi-square goodness-of-fit

Excel Chi-square goodness-of-fit

SPSS Chi-square goodness-of-fit

R Chi-square goodness-of-fit

1 (+) SampleBinomial Logistic Regression

A statistical model used when analysing dichotomous data that may depend on a number of factors. The logistic regression model allows the effects of all factors to be studied simultaneously. Results are usually expressed in terms of odds ratio.

Example of Binomial Logistic Regression

 

SPSS Binomial Logistic Regression

R Binomial Logistic Regression

2 Samples

Paired

(or dependent)

McNemar's test

Comparing differences between paired (or related) dichotomous data.

Example of McNemar's test

 

SPSS McNemar's test

R McNemar's test

2 Samples

Agreement

(2 raters)

Cohen's Kappa

A measure of agreement between two raters recording a categorical outcome variable.

Example of Cohen's Kappa

 

SPSS Cohen's Kappa

R Cohen's Kappa

2 (+) Samples

Unpaired

(or independent)

Chi-squared test of association

A nonparametric test designed to explore if there is an association or relationship between two categorical variables.

Example of Chi-squared test of association

Excel Chi-squared test of association

SPSS Chi-squared test of association

R Chi-squared test of association

2 (+) Samples

Unpaired

(or independent)

Fisher's exact

A nonparametric test designed Expected values (E ≤ 5) in for more than 25% of cases. The example describes a Chi-squared test and details when to use the Fisher's exact test and details which output variables to report.

Example of Fisher's exact

 

SPSS Fisher's exact

R Fisher's exact

3 (+) SamplesCochran's Q-test

Cochran's Q-test determines if there are differences between three or more related groups.

Example of Cochran's Q-test

 

SPSS Cochran's Q-test

R Cochran's Q-test