A Quick Guide to SPSS Conditional Syntax (AND, NOT, OR, NE)
ฝัง
- เผยแพร่เมื่อ 8 ก.พ. 2025
- For the best experience, please watch on full screen mode, at high resolution.
Learn how to apply SPSS conditional syntax. (AND, NOT, OR, NE)
Check out the GitHub for sample code and data:
github.com/RDS...
Also, check out the website for other articles and tutorials:
www.reflection...
Please come visit us for all of your data science needs!
Disable Filter *
FILTER OFF.
Apply Filter *
USE ALL.
COMPUTE filter_$=(Gender=0).
FILTER BY filter_$.
EXECUTE.
Perform Analysis *
TITLE "Favorite Music Genre Amonst Females".
FREQUENCIES VARIABLES = FavGenre
/ORDER = ANALYSIS.
Applying Multiple Filters (AND) *
USE ALL.
COMPUTE filter_$=(Gender = 0 AND EyeColor = 2).
FILTER BY filter_$.
EXECUTE.
Perform Analysis *
FREQUENCIES VARIABLES = FavGenre
/ORDER = ANALYSIS.
Applying NOT EQUAL Filter *
USE ALL.
COMPUTE filter_$ = (Gender NE 0).
FILTER BY filter_$.
EXECUTE.
Perform Analysis *
FREQUENCIES VARIABLES = FavGenre
/ORDER = ANALYSIS.
Applying Multiple Filters (OR) *
USE ALL.
COMPUTE filter_$ = (FavGenre = 1 OR FavGenre = 2).
FILTER BY filter_$.
EXECUTE.
Perform Analysis *
FREQUENCIES VARIABLES = FavGenre
/ORDER = ANALYSIS.
VARA,VARB,VARC,VARD
Mike,1,Red,Spade
Mike,2,Blue,Club
Mike,1,Red,Spade
Troy,2,Green,Diamond
Troy,1,Red,Heart
Archie,2,Orange,Heart
Archie,2,Yellow,Diamond
Archie,2,Orange,Heart
Archie,1,Red,Spade
Archie,1,Blue,Spade
Archie,2,Red,Club
Archie,2,Red,Club
Jack,1,Red,Diamond
Jack,2,Blue,Diamond
Jack,2,Blue,Diamond
Rob,1,Green,Club
Rob,2,Orange,Spade
Brad,1,Red,Heart
Susan,2,Blue,Heart
Susan,2,Yellow,Club
Susan,1,Pink,Heart
Seth,2,Grey,Heart
Seth,1,Green,Club
Joanna,2,Pink,Club
Joanna,1,Green,Spade
Joanna,1,Green,Spade
Bertha,2,Grey,Diamond
Bertha,1,Grey,Diamond
Liz,1,Green,Spade