Preface
Part I: An Introduction to SPSS
1. What Is SPSS?
SPSS as a High-Level Programming Language
SPSS as a Statistical Analysis Package
2. Interacting With SPSS
Basics About SPSS Commands
Order of Execution of SPSS Commands
Batch Mode and Interactive Mode
3. Types of Files in SPSS
The Command or Syntax Files
The Active or Working Data File
4. Customizing the SPSS Environment
Displaying Current Settings
Changing Current Settings
Increasing Memory Allocation
Changing the Default Format for Numeric Variables
Part II: An Introduction to Computer Programming With SPSS
5. An Introduction to Computer Programming
Using Syntax Versus the Menu System
The Process of Writing and Testing Syntax
Typographical Conventions Used in This Book
How Code and Output Are Presented in This Book
Some Reasons to Use Syntax
Beginning to Learn Syntax
6. Programming Errors
Syntax Errors and Logical Errors
Common SPSS Syntax Errors
Changing Default Error and Warning Settings
Deciphering SPSS Error and Warning Messages
7. Documenting Syntax, Data, and Output Files
Using Comments in SPSS Programs
Using Comments to Prevent Code From Executing
Echoing Text in the Output File
Using Titles and Subtitles
Part III: Reading and Writing Data Files in SPSS
8. Reading Raw Data in SPSS
The FIXED, FREE, and LIST Formats
Specifying the Delimiter Symbol
Reading Aggregated Data With DATA LIST
Reading Data With Multiple Records Per Case
Using FORTRAN-Like Variable Specifications
Two Shortcuts for Declaring Variables With Identical Formats
Specifying Decimal Values in Data
9. Reading SPSS System and Portable Files
Reading an SPSS System File
Reading an SPSS Portable File
Dropping, Reordering, and Renaming Variables
10. Reading Data Files Created by Other Programs
Reading Microsoft Excel Files
Reading Data From Earlier Versions of Excel
Reading Data From Later Versions of Excel
Using GET TRANSLATE to Read Other Types of Files
Reading Data From Database Programs
11. Reading Complex Data Files
Reading Grouped Data Files
Reading Nested Data Files
Reading Data in Matrix Format
12. Saving Data Files
Saving an SPSS System File
Saving an SPSS Portable Data File
Saving a Data File for Use by Other Programs
Part IV: File Manipulation and Management in SPSS
13. Inspecting a Data File
Determining the Number of Cases in a File
Determining What Variables Are in a File
Getting More Information About the Variables
Checking for Duplicate Cases
Looking at Variable Values and Distributions
Creating Standardized Scores
14. Combining Data Files
Adding New Variables to Existing Cases
Adding Summary Data to an Individual-Level File
Combining Cases From Several Files
Updating Values in a File
Reordering and Dropping Variables in the Active File
Eliminating Duplicate Records
16. Restructuring Files
Changing File Structure From Univariate to Multivariate
Incorporating a Test Condition When Restructuring a File
Changing File Structure From Multivariate to Univariate
Transposing the Rows and Columns of a Data Set
17. Missing Data in SPSS
System-Missing and User-Missing Data
Looking at Missing Data on Individual Variables
Looking at the Pattern of User-Missing Data Among Pairs of Variables
Looking at the Pattern of Missing Data Across Many Variables
Changing the Value of Blanks in Numeric Fields
Treatment of Missing Values in SPSS Commands
Substituting Values for Missing Data
18. Using Random Processes in SPSS
Generating Random Distributions
Random Selection of Cases
Random Selection From Multiple Groups
Part V: Variables and Variable Manipulations
19. Variables and Variable Formats
String and Numeric Variables
The COMMA, DOT, DOLLAR, and PCT Formats
20. Variable and Value Labels
Rules About Variable Names in SPSS
Systems for Naming Variables
Controlling Whether Labels Are Displayed in Tables
Applying the Data Dictionary From a Previous Data Set
21. Recoding and Creating Variables
The RECODE and AUTORECODE Commands
Converting Variables From Numeric to String or String to Numeric
Counting Occurrences of Values Across Variables
Counting the Occurrence of Multiple Values in One Variable
Creating a Cumulative Variable
22. Numeric Operations and Functions
Mathematical and Statistical Functions
Missing Values in Numeric Operations and Functions
A Substring-Like Technique for Numeric Variables
23. String Functions
Searching for Characters Within a String Variable
Adding or Removing Leading or Trailing Characters
Finding Character Strings Identified by Delimiters
24. Date and Time Variables
How Date and Time Variables Are Stored in SPSS
An Overview of SPSS Date Formats
Reading Dates With Two-Digit Years in the Correct Century
Creating Date Variables With Syntax
Creating Date Variables From String Variables
Extracting Part of a Date Variable
Doing Arithmetic With Date Variables
Creating a Variable Holding Today's Date
Designating Missing Values for Date Variables
Part VI: Other Topics
25. Automating Tasks Within Your Program
The DO IF Command Structure
The DO REPEAT Command Structure
The LOOP Command Structure
26. A Brief Introduction to the SPSS Macro Language
Specifying Arguments by Position
Macros Using a Flexible Number of Variables
Controlling the Macro Language Environment
Sources of Further Information About SPSS Macros
27. Resources for Learning More About SPSS Syntax
References
Index
About the Author