Tech Tips

Count Occurrences within Cases

To improve your experience using IBM SPSS Statistics, the Version 1 SPSS experts have created various Tech Tips. This Tech Tip shows how to count occurrences within cases.  

In IBM SPSS Statistics, you can work inside a single, integrated interface to run descriptive statistics, regression, advanced statistics and machine learning models. You can create publication-ready charts, tables, and decision trees in one tool. IBM SPSS Statistics is easy to use, provides analysis automation, comprehensive statistical tools, integration with open source, and help at your fingertips. 

Count occurrences in cases is a time-saving procedure in IBM SPSS Statistics. This procedure allows users to count values across variables or within variables. For example, you might have a satisfaction survey that contains many questions with the same scale. This procedure calculates the total number of ‘Strongly Positive’ responses across several questions. Using count values within cases replaces running frequencies on several variables and copying and pasting category counts. 

For example, we have data with five questions that have the same response categories. These categories are:

  • 1 = Strongly Negative
  • 2 = Somewhat Negative
  • 3 = Neutral
  • 4 = Somewhat Positive
  • 5 = Strongly Positive

Let’s count the number of ‘Strongly Positive’ responses across the variables. To Count values within cases, go to the Transform Menu. Select Count values within cases. Select the variable to include in the analysis. In the Target Variablebox, type ‘Strongly_Positive’. In the Target Labelbox, type ‘Count of Strongly Positive Responses+’. Select the questions and move them to the Numeric Variablesbox. Click on Define Values. As we want to count occurrences of ‘Strongly Positive,’ select the Value button and type ‘5’. Click on Add to Values to Count box. Other options include specifying a range of values or specifying missing values as the value to count. Select Continue and OK in the main dialogue box. Now you have a new variable in your data which counts ‘Strongly Positive’ across questions. 

Tools Covered

IBM SPSS Statistics

Related Solutions


Tagged As IBM SPSS Statictics For Advanced

Need some help?

Image of three women working on laptops at a table for Version 1 SPSS Training

Learn how to use SPSS from the experts

With more than 20 years of delivering highly successful training programs, Version 1 offers a wide range of training options to best suit your requirements, enabling you to optimise your IBM SPSS Software, achieve your analytical goals and continually improve your results.

Related Tech Tips

Our SPSS experts have created a range of Tech Tips for IBM SPSS Statistics. Take a look through.

Arrange a free consultation to discuss your analytical needs, and identify the best solution for you.