Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

9
Count Occurrences within a case in IBM SPSS Statistics

Transcript of Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

Page 1: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

Count Occurrences within a

case in IBM SPSS Statistics

Page 2: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

Why count occurrences of values within cases ?

You might have a satisfaction survey that contains a lot of

questions with the same scale

• You can use this procedure to calculate the total number of “Very

Satisfied” responses a respondent gave across a number of questions

You might have a survey that contains a list of magazines where

each magazine is a variable and each respondent indicates Yes or

No for each magazine

• You can use this procedure to calculate the total number of magazines

each person reads

2

Page 3: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

• We will use the sample file “satisf.sav”

• Located in C:\Program Files\IBM\SPSS\Statistics\*Version\Samples\English

*Version: Your SPSS Statistics Version,

e.g. 20, 21, 22,…

• The last 6 variables price,

numitems, org, service, quality & overall all have the same scale

• 1 = Strongly Negative

• 2=Somewhat Negative

• 3= Neutral

• 4=Somewhat Positive

• 5=Strongly Positive

Counting occurrences example

3

Page 4: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

• Let’s count the number of occurrences of “Strongly Positive” across the 5 variables

• To create this count variable: Transform -> Count Values within cases

Counting occurrences: Strongly Positive

4

Page 5: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

• In Target Variable type “Count_Strongly_Positive”

• In the Target Label type “Count of Strongly Positive Responses

• Select the six variables from the variable list on the left hand side and place them in the Numeric_Variables: list

Counting occurrences example

5

Page 6: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

• As we want to count the number of “Strongly Positive” responses for each respondent and this label corresponds to 5, we will specify 5 in the value and click Add

• Other options include specifying a range of values or specifying missing values as the values to count

• Select Continue and select OK in the main dialog

Counting occurrences: Define Values

6

Page 7: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

New variable: Count_Strongly_Positive

7

Page 8: Tech Tips: Count Occurrences within a case in IBM SPSS Statistics

The If cases dialog box allows you to count occurrences of

values for a subset of cases using conditional expressions

• If the result of a conditional expression is true, the case is

included in the selected subset

• If the result of a conditional expression is false or missing, the

case is not included in the selected subset

Count Cases – other options

8