You are on page 1of 39

research.library.gsu.

edu/spss-workshops 
SPSS 3: Basic Coding In SPSS
George Usmanov, B.S.
Research Data Services
• Faculty who are Research and Data Specialists
– Dr. Swygart-Hobaugh: Qualitative Methods
– Joel Glogowski: Data Visualization
– Kelsey Jordan: Data Visualization
– Dr. Raeda Anderson: Quantitative Methods
– Jeremy Walker: Quantitative Methods
– George Usmanov: Quantitative Methods

• General Information: click here

• Workshops: click here

• Individual and Group Consultations: email to schedule

• Drop-In Hours: click here 3


Data Certification
• Attend 5 different workshops this semester
• Earn a data certification through Research Data Services

4
5
6
Overview
• SPSS Introduction
• Writing SYNTAX in SPSS
• Pros/cons of coding in SPSS
• GSS Dataset Overview
• Helpful Resources
• Lab in SPSS
SPSS Introduction
• SPSS= Statistical Package for the Social Sciences
SPSS Introduction
• SPSS= Statistical Package for the Social Sciences
• Point & click and coding options for running analysis
SPSS Introduction
• SPSS= Statistical Package for the Social Sciences
• Point & click and coding options for running analysis
• SPSS calls code ‘SYNTAX’
SPSS Introduction
• SPSS= Statistical Package for the Social Sciences
• Point & click and coding options for running analysis
• SPSS calls code ‘SYNTAX’
• SYNTAX files are saved as ‘.sps’
SPSS Introduction
• SPSS= Statistical Package for the Social Sciences
• Point & click and coding options for running analysis
• SPSS calls code ‘SYNTAX’
• SYNTAX files are saved as ‘.sps’
• Data files are saved as ‘.sav’
SPSS Introduction
• SPSS= Statistical Package for the Social Sciences
• Point & click and coding options for running analysis
• SPSS calls code ‘SYNTAX’
• SYNTAX files are saved as ‘.sps’
• Data files are saved as ‘.sav’
• Commands= keywords for specific procedures SPSS runs
SPSS Introduction
• SPSS= Statistical Package for the Social Sciences
• Point & click and coding options for running analysis
• SPSS calls code ‘SYNTAX’
• SYNTAX files are saved as ‘.sps’
• Data files are saved as ‘.sav’
• Commands= keywords for specific procedures SPSS runs
• Short keys
– ‘F2’ highlighting a command where the text cursor is located
– ‘Ctrl + a’ for highlighting all SYNTAX in a file
– ‘Ctrl + r’ for running all highlighted commands
Writing SYNTAX in SPSS
• You can directly type commands into SPSS SYNTAX file
Writing SYNTAX in SPSS
• You can directly type commands into SPSS SYNTAX file
• Autocomplete function
Writing SYNTAX in SPSS
• You can directly type commands into SPSS SYNTAX file
• Autocomplete function
• Color Coding
– Blue: commands (e.g., COMPUTE, ONEWAY)
– Green: subcommands (e.g., OPTIONS, TABLES)
– Maroon: keywords (e.g., IF, BY, AND)
– Orange: keyword values (WITH, PAIRED)
– Gray: comments
– Black: variable names and other texts
– Red: syntactical error
Writing SYNTAX in SPSS
• Unique ‘rules’ to writing SYNTAX in SPSS
– commands must start on a new line
– commands end with a period
– ‘/’ indicate subcommands
– SYNTAX for commands are case insensitive
– ‘EXECUTE’ is only needed with transformation commands
Writing SYNTAX in SPSS
• Unique ‘rules’ to writing SYNTAX in SPSS
– commands must start on a new line
– commands end with a period
– ‘/’ indicate subcommands
– SYNTAX for commands are case insensitive
– ‘EXECUTE’ is only needed with transformation commands
• Abbreviations for many commands
– e.g., FREQUENCIES = freq
– e.g., VARIABLES = var
Breakdown of SYNTAX
• SPSS default format

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.
Breakdown of SYNTAX
• SPSS default format
Command

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.
Breakdown of SYNTAX
• SPSS default format
Command Indicating the
presence of
variables

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.
Breakdown of SYNTAX
• SPSS default format
Command Indicating the Variable being
presence of analyzed
variables

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.
Breakdown of SYNTAX
• SPSS default format
Command Indicating the Variable being
presence of analyzed
variables

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.

Subcommand
for statistics
included
Breakdown of SYNTAX
• SPSS default format
Command Indicating the Variable being
presence of analyzed
variables

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.

Subcommand Specific
for statistics statistics
included
Breakdown of SYNTAX
• SPSS default format
Command Indicating the Variable being
presence of analyzed
variables

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.

Subcommand Subcommand for Specific


for statistics organizing output statistics
included
Breakdown of SYNTAX
• SPSS default format
Command Indicating the Variable being
presence of analyzed
variables

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.

Subcommand Subcommand for Specific Specific


for statistics organizing output order statistics
included
Breakdown of SYNTAX
• SPSS default format
Command Indicating the Variable being
presence of analyzed
variables

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.

Subcommand Subcommand for Specific Specific


Period
for statistics organizing output order statistics
included
Breakdown of SYNTAX
• SPSS default format

FREQUENCIES VARIABLES=SPDEG
/STATISTICS= RANGE MEAN MEDIAN MODE

/ORDER=ANALYSIS.

• ‘Simple’ SYNTAX

freq spdeg/statistics range mean median mode.


Pros/cons of coding in SPSS

Pros Cons
Reproducible Research Learning a new language
Communication
Knowing exactly what
variables and analysis
Speed of analysis
Retracing mistakes
GSS Dataset Overview
• General Social Survey (GSS)
GSS Dataset Overview
• General Social Survey (GSS)
• Since 1972
GSS Dataset Overview
• General Social Survey (GSS)
• Since 1972
• Biennial longitudinal cross-sectional
GSS Dataset Overview
• General Social Survey (GSS)
• Since 1972
• Biennial longitudinal cross-sectional
• Most widely used dataset for social scientists
GSS Dataset Overview
• General Social Survey (GSS)
• Since 1972
• Biennial longitudinal cross-sectional
• Most widely used dataset for social scientists
• Data on attitudes, behaviors, and attributes of American
society
GSS Dataset Overview
• General Social Survey (GSS)
• Since 1972
• Biennial longitudinal cross-sectional
• Most widely used dataset for social scientists
• Data on attitudes, behaviors, and attributes of American
society
• 2018 GSS includes
– science, discrimination, attitudes regarding abortions, pets,
quality of working life, self-assessments of physical and
psychological health, attitudes toward people with mental health
problems, the role of the natural environment in people’s
lives, religion, social networks and social resources.
Helpful Resources
• GSU SPSS: https://research.library.gsu.edu/spss-workshops
• SPSS Tutorials: https://www.spss-tutorials.com
• UCLA SPSS: https://stats.idre.ucla.edu/spss/
• Kent State SPSS: https://libguides.library.kent.edu/SPSS/Syntax
• IBM SPSS:
https://www.ibm.com/support/knowledgecenter/en/SSLVMB_24.0.0/spss/bas
e/command_syntax.html
• GSS Data:
http://www.norc.org/Research/Projects/Pages/general-social-survey.aspx
Lab in SPSS
research.library.gsu.edu/spss-workshops 

You might also like