"

6 Filtering Data via Categorical Variables

It is sometimes necessary to only select data from specific groups or conditions for analysis. Alternatively, you may wish to look at a specific subset of participants in isolation from the rest of your sample. This can be done by filtering the data based on any categorical (nominal) variable within the data set.

Example

We wish to investigate possible gender differences in the social support that clinically depressed participants receive. As such, we must filter out participants who are ‘Not clinically depressed’.

How do I do that?

1. Open Variable View for the categorical variable you wish to use for filtering.

image

 

2. Click on the tick mark under the column Filter for whichever group/condition you wish to exclude. In this example, we wish to exclude participants who are ‘Not clinically depressed’ from the ‘Depression Group’).

An x mark indicates that the group/condition has been filtered out.

image

3. Any descriptive statistics or analyses you do with the data set will not include participants who have been filtered out. Your data set should look something like this:

image

Licence

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Statistics with JASP: First Steps for Psychology Students Copyright © 2025 by The authors and the University of Sheffield is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.