Tech Tip: The Any Function in IBM SPSS Statistics
-
Upload
presidion -
Category
Data & Analytics
-
view
298 -
download
0
Transcript of Tech Tip: The Any Function in IBM SPSS Statistics
![Page 1: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/1.jpg)
The ANY function
in IBM SPSS Statistics
![Page 2: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/2.jpg)
The ANY function
• A very useful logical function
- ANY(test, value1, value2, ....)
• Returns a value of 1 if the test is true and 0 otherwise.
• e.g. ANY(var1, 1, 3, 5)
- Will return a value of 1 if var1 has a value of 1, 3 or 5.
Otherwise it will return a value of 0
• Instead of using a series of or statements
- ANY(var1, 1, 3, 5) = (var1=1 or var1=3 or var1=5)
2
![Page 3: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/3.jpg)
The ANY function
The ANY function can also be used to scan a list of variables
or expressions for a value
.For example ANY(1, var1, var2, var3) returns a value of 1 if
any the specified variables have a value of 1, otherwise it will
return a value of 0.
The equivalent logical statement using or statements would
be
• (var1=1 or var2=1 or var3=1)
3
![Page 4: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/4.jpg)
Sample file: cable_survey.sav
4
![Page 5: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/5.jpg)
An example of the ANY function
Using cable_survey.sav located in
C:\Program Files\IBM\SPSS\Statistics\*Version\Samples\English
*Version: Your SPSS Statistics Version, e.g. 20, 21, 22,…
We will use the ANY function
in the select cases procedure
to create a new dataset with
categories 1, 3 and 4 of the
variable hometype
5
![Page 6: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/6.jpg)
Select Cases
Data -> Select Cases -> If condition is satisfied
6
![Page 7: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/7.jpg)
Select cases out to a new dataset
Create a new dataset
7
![Page 8: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/8.jpg)
View the Results
8
![Page 9: Tech Tip: The Any Function in IBM SPSS Statistics](https://reader036.fdocuments.in/reader036/viewer/2022092615/58732cd71a28ab596c8b5e43/html5/thumbnails/9.jpg)
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