SPSS Syntax - George Mason University

1y ago
7 Views
1 Downloads
763.56 KB
38 Pages
Last View : 14d ago
Last Download : 3m ago
Upload by : River Barajas
Transcription

SPSS Syntax For Academics

What is Syntax? Instructions to SPSS Just a text file GUI is creating and runing syntax

Why use Syntax Faster – Faster to type than to click – Faster to run Easier – Easy to do the same thing with different variables – Easier to find errors Better – Features not available on the menues – Ensures Replicability

Pew Social Trends Click the Workshop Files Icon: Choose SPSS Workshop Files Choose Pew Social Trends-Family Bonds Open “PST 11-05c.sav” – Double-Click or File Open (if SPSS is open)

Structure COMMAND /SUBCOMMAND KEYWORD .

Look at the Syntax for the Get File How many commands? Copy it to a new syntax file

Options: Viewer

Obtaining Syntax File New Syntax From Viewer Double-Click syntax area Select, Copy, and Paste

Windows Data .sav Unsaved Output .spv Active Inactive Syntax .sps

DATASET DATASET NAME DATASET ACTIVATE Temporary names Important if multiple datasets are open, irrelevant otherwise

Good Practices

Files A0 Raw Data A1 Import A2 Setup B0 Raw SPSS B1 Transform B2 Prepare C0 Analysis C1 Describe C2 Analyze C1 C2

Style SPSS words are CAPS Variables are lower case Use parentheses Put command on multiple lines Indent

COMMENT COMMENT The following is for SPSS with Syntax. OR * The following Is for SPSS with Syntax. **********************. **** Leave a Comment ***.

Specific Skills

Variables & Labels RENAME VARIABLES (sex gender) . VARIABLE LABELS gender “Respondent’s Gender”. MISSING VALUES q2 (9). MISSING VALUES q3a TO q3j (7,9).

Frequencies FREQUENCIES VARIABLES q2 /ORDER ANALYSIS. FREQUENCIES q2. FREQUENCIES q2 q75.

Compute COMPUTE has pet (q75 1). COMPUTE FUNCTION(stuff). AND & OR EQ Operations NOT NE GT GE LT LE

Recode RECODE q2 (1 1) (2 1) (3 0) INTO is happy. RECODE q2 (1 THRU 2 1) (3 0) INTO is happy. RECODE q2 (1 2 1) (3 0) INTO is happy. RECODE q2 (1, 2 1) (3 0) INTO is happy.

Keywords for Recoding THRU LO / LOWEST HI / HIGHEST ELSE MISSING SYSMIS COPY INTO list of values or cases lowest value highest value all other values user or system missing value system missing value outputs the same value preceeds name of new variable

Syntax can be written different #2 RENAME VARIABLES (var1 one) (var2 two) . RENAME VARIABLES (var 1 var2 one two) . RENAME VARIABLES var1 one var2 two .

EXECUTE Can be abbreviated: EXE. Many executes slow it down. Typically needed once per file. Can be run at any time

Combining Commands VARIABLE LABELS has pet “Has a Pet?” / is happy “Happy?” . OR VARIABLE LABELS has pet “Has a Pet?” . VARIABLE LABELS is happy “Happy?” .

Value Labels VALUE LABELS has pet 0 No Pet 1 Has a Pet . VALUE LABELS is happy 1 Happy . ADD VALUE LABELS is happy 0 Not Happy .

Syntax can be written different #1 val labels has pet 0 “No Pet” 1 “Has a Pet” . value lab has pet 1 ‘Has a Pet’ 0 ‘No Pet’. VALUE LABELS has pet 0 No Pet 1 Has a Pet .

Crosstabs Analyze Descriptive Statistics Crosstabs

General Keywords Variables BY for factors WITH for covariates ALL all variables TO variable list

Subcommand Efficiency Subcommands only needed to change defaults Compare to pasted syntax FREQUENCIES gender. CROSSTABS q76dog by is happy. CROSSTABS q76dog by is happy /CELL COL ROW /STA CHISQ .

Combining Commands CROSSTABS /TABLES has pet is happy BY married gender /TABLES has pet BY gender /TABLES is happy BY married /FORMAT DVALUE TABLES /CELLS COUNT EXPECTED COLUMN.

Handling Errors

COMPUTE timezone UPPER(tz) FREQUENCIES timezone

Don’t Panic Fix the First Ignore the number of errors and focus on the first one SPSS doesn’t stop for errors Fixing the 1st may fix others Read the message Error messages are long but often informative Identifies location of problem Gives suggestions

Look for Common Errors Check for EXECUTE Changes to the data require an execute Look for “Transformations Pending” in the Status Bar Type “EXECUTE.” and run it Needed after COMPUTE, RECODE, IF, and others Check for periods The most common error is missing or extra periods Each command ends with a period Each period must end a command Blank lines are treated a periods

Troubleshooting Run all Frequencies Copy your variables from each command and run frequencies Confirm names are correct Confirm expected values Run each Command Starting at the top, run each command alone, step by step Highlight the syntax you want to run

Correct Code STRING timezone (A3). COMPUTE timezone UPCASE(tz).

Tips

Creating Syntax in Excel Use Excel “Fill Down” for Repetative Commands See SPSS Syntax.xlsx

Advanced Topics http://spsstools.net/

SPSS Syntax For Academics . What is Syntax? Instructions to SPSS Just a text file GUI is creating and runing syntax . Why use Syntax Faster - Faster to type than to click - Faster to run Easier - Easy to do the same thing with different variables

Related Documents:

Here is what the three main windows in SPSS 17.0—SPSS Data Editor, SPSS Syntax Editor, and SPSS Viewer—look like in the Windows operating environment . The SPSS Data Editor window shows the active data file. The SPSS Syntax Editor window has an SPSS program typed into it. The results of the program appear in the SPSS Viewer window.

You can run SPSS using either the pull-down menus or the Syntax Editor. The former method is a menu-driven approach, while the latter method involves writing your own SPSS programs. We will begin by using the pull-down menus to run SPSS. The use of the syntax window to run SPSS will be deferred until Chapter 7. SPSS FILES SPSS uses several .

What is SPSS syntax SPSS Syntax is a command language that is unique to SPSS Statistics. Effectively, it's the SPSS operating system. The language was developed in the 1960's and so pre-dates Windows/Mac versions of SPSS by some margin

SPSS for Windows Version 19.0: A Basic Tutorial Linda Fiddler, California State University, Bakersfield . all you have to do to start IBM SPSS is to point to the IBM SPSS 19 icon on the desktop and double click. Then wait while IBM SPSS loads. After IBM SPSS loads, you may, depending on how IBM SPSS is set up, get a menu that .

SPSS Tutorial and Help 6 SPSS Step-by-Step 5. Select View from the menu again and make sure that Value Labels is checked. If it isn't, click it once to select it. You can turn value labels on or off at any time during an SPSS session. SPSS Tutorial and Help SPSS provides extensive assistance through its online help, tutorial, syntax guide,

For a general idea of George Mason’s Admission Standards, below is a blurb by Allen Grove, College Admissions Expert, from the website “About.Com” Discussion of George Mason's Admissions Standards: Over a third of applicants to George Mason University don't get in. Successful app

1. Launch an instance of SPSS 19 a. At the top-left, click File Open Syntax i. Find you your syntax file, and click [Open] 1. Diabetes_Student.sps is for you to type and/or paste syntax into as you follow along a. Open this one for good practice 2. Diabetes_Workbook.sps is the master file containing all of the correct syntax ii.

the bridge, while it is appreciated there will be some economy of scale there is a limited number of specialist companies who will be able to carry out these works to the required standard. Figure 111. Parapet Repairs Figure 12. Parapet Reconstruction . Blackfriars Bridge Refurbishmet AECOM 13 6. Stake Holders Figure13. Bridge Elevation Due to the pivotal role played by Blackfriars bridge in .