Count the Number of Occurrences in a Sorted Array _ GeeksforGeeks
Tech Tips: Count Occurrences within a case in IBM SPSS Statistics
-
Upload
presidion -
Category
Data & Analytics
-
view
231 -
download
0
Transcript of Tech Tips: Count Occurrences within a case in IBM SPSS Statistics
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
• 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
• 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
• 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
• 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
New variable: Count_Strongly_Positive
7
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
www.presidion.com
Talk to us
[email protected] +44 (0)208 757 8820 (UK) +353 (0)1 415 0234 (IRL)
www.presidion.com/ibm-spss-technical-tips
For more Tech Tips
visit