intro to spssonline.sfsu.edu/beca703/lecture/spss.1.pdf · introduction to spss on the macintosh....

14
Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State University Spring 2000 This is a brief guide to using SPSS in the Macintosh Operating Environment. The rules are similar in the Windows Operating Environment, you should be able to make the shift from this guide to a Windows version of SPSS. Just be aware some terms are different. If you have difficulty, ask your instructor. This guide presumes user knowledge of the Macintosh Operating System, Basic file management using external storage media (zip disk or floppy), and knowledge of basic word processing (MS Word for example) and basic spread-sheet operations (MS Excell). Basic Orientation. SPSS for the Mac consists of four different operating components: The Data Window – Where the raw observations (data) are recorded. This is the window that looks like a spread-sheet (with rows and columns). If you create or modify a variable, it will appear in the data window.

Upload: others

Post on 25-May-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

Introduction to SPSS on the Macintosh.

Scott Patterson,Ph.D.Broadcast and Electronic Communication Arts

San Francisco State University

Spring 2000

This is a brief guide to using SPSS in the Macintosh Operating Environment. The rules aresimilar in the Windows Operating Environment, you should be able to make the shift from thisguide to a Windows version of SPSS. Just be aware some terms are different. If you havedifficulty, ask your instructor. This guide presumes user knowledge of the Macintosh OperatingSystem, Basic file management using external storage media (zip disk or floppy), and knowledgeof basic word processing (MS Word for example) and basic spread-sheet operations (MS Excell).

Basic Orientation.

SPSS for the Mac consists of four different operating components:

The Data Window – Where the raw observations (data) are recorded. This is the window thatlooks like a spread-sheet (with rows and columns). If you create or modify a variable, it willappear in the data window.

Page 2: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

The Syntax Window – Where you can create syntax (a list of commands) for SPSS to execute.You can execute commands from the syntax window or from the drop down menus. Many ofthe command screens give you the option to paste syntax into the syntax window.

Page 3: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

The Chart Carousel – Where charts and other graphic output is directed.

Part of understanding SPSS is to learn which window is used for what purpose. The majority ofwork in your first lab will be in learning how to create a data file that contains raw data anddefinitions of the variables.

The Data File

The first step in working with SPSS to create the definitions in the data file. Every variable getsits own unique column in the data set and every row is a specific case (a completed survey forexample).

Page 4: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

In the above window, the columns titled “acchome” (do you access the Internet from home?) and“accwork” (do you access the Internet from work?) represent questions asked on a survey called(BEV Combined.SPSS.DEF). Each row (#1, 2, 3, 4, etc..) down the left-hand side of thewindow (in the gray bar) represents an individual respondent. For example, respondent #1recorded a score of “1” for acchome and “1” for accwork (a “yes”) while respondent #7 indicateda “2” for acchome and a “1” for accwork (h/she accesses the Internet from work but not fromhome). Respondent #6 recorded a score of “2” for the variable accoth.

Before you can enter any data (observations) into SPSS you must first define the variables withwhich you will be working. To illustrate how to create an SPSS data set, we will create a datasetfor keeping track of the grades in BECA 390.

The BECA390 Gradebook.

BECA 390 is a class with 75 students. For each student we will record the followinginformation:

Page 5: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

Variable Variable TypeID Number String (123-45-6789)First Name StringLast Name StringExam 1 Score Numeric (Ratio level)Exam 2 Score NumericExam 3 Score Numeric

Still prior to doing any programming, we need to gather more information. SPSS asks that eachvariable be given a unique variable name. SPSS has some very specific rules for creatingvariable names:

• names can have no spaces or punctuation.• names must be all lowercase letters and numbers• names must be NO LONGER than 8 characters

Variable Variable Type SPSS Variable NameID Number String (123-45-6789) idFirst Name String firstLast Name String lastExam 1 Score Numeric (Interval level) exam1Exam 2 Score Numeric exam2Exam 3 Score Numeric exam3

Now we have the minimum amount of information we need to create our data file definitions.

Step 1 – Start SPSS by double-clicking on the SPSS icon:

Page 6: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

Step 2 – SPSS should default open to a blank data window. From here, define the first variable(id) by using the data drop-down menu:

The Define Variable Command brings up the define variable dialog box. In this box, first typethe name of the variable and then click the “type” button:

Page 7: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

The type button brings up the “type” dialog box where you indicate “id” is a string variable:

Notice you can also tell SPSS how many characters you will allow for the variable. In this casewe chose 15 since our ID number takes a minimum of 12 characters. Click “Continue” to goback to the define variable dialog box. You can do many other things in the variable dialog boxthat aren’t important to the BECA 390 grade book. For example, if we had a variable calledclass rank that we recorded as a numeric variable so we could use it in statistical analysis (wecan’t use string variables in statistical analysis). We would use the “Labels” button to bring up adialog where we could assign words to the numbers recorded in the database:

Page 8: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

You should always choose “compress spss data. You should create the other five variables forthe BECA 390 Gradebook Data Set now. The completed data window should look somethinglike:

Entering Observations into the Data Window

Page 9: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

A second way of entering observations is to cut and paste different rows or columns in fromanother spread-sheet application like Microsoft Excell. This cut and paste method is especiallyhelpful for gradebooks at SFSU as the university computer center will provide you with anelectronic version of your class list in the Microsoft Excell Format. For this assignment, Iprovided you with a complete list of the BECA 390 student id numbers, first and last names inMicrosoft Excell. You can just cut and paste and entire Excell spread-sheet into the SPSS DataWindow. To do this:

1. Open the Excell Document and the SPSS Data Window2. Select all of the columns and rows you want to cut and paste3. Select cut or copy from the edit menu4. Switch (using the multi-finder) to the SPSS Data Window5. Click on the first cell (row 1, column 1).6. Select paste from the edit menu.7. SAVE SAVE SAVE SAVE.

A third way of entering observations is VERY COOL. This technique is the one you willprobably use the most. This technique involves “importing” observations into the SPSS DataWindow. Let’s get away from the gradebook example for a minute and imagine we had around400 surveys of data we needed to enter into the Data Window. To do each of these by hand ineither SPSS or Excell would be very time consuming because of all the extra key-strokes youneed to use to navigate among the cells (tab, return, and enter). It would be easier to enter all theobservations (numbers representing responses) into the computer using a word processor andthen to save those observations as a text file:

Page 10: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

instructed to save each individual survey in a text file with a tab between each answer and ahard-return after each last answer (the four digit id-number – 5592). Importing text from a textfile is one of the easiest ways to import data to spss.

To import data from a text file, you can do it in one of two ways. You can use the read ascii dataoption from the file menu and the follow the menus to define your data set.

The advantage of the read ascii data command is that you do not have to define your datafilebefore you import the data. However, to use the read ascii data, you really need to know howyour dataset is constructed. I prefer to read my text (ascii) files first into Microsoft Excell(which has an excellent text import function) and then do a cut and paste as explained above.

Creating New Variables in the Data Window

Once we have our raw observations entered into the data window, we may need to create newvariables based on some combination of observed variables. For example, in our gradebook, wemight need to create a new variable called “totpts” that represents the total points earned on thethree examinations. We also might want to calculate a new variable that represents thepercentage of available points earned by a student. We will call this variable “totper.”

Variable Variable Type SPSS Variable NameID Number String (123-45-6789) idFirst Name String firstLast Name Numeric (Interval level) exam1Exam 2 Score Numeric exam2Exam 3 Score Numeric exam3Total Points Numeric totptsPercentage of all points Numeric totper

To calculate new variables from existing variables, use the “compute” command from the

Page 11: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

This command will bring up the compute dialog box where you can specify how variables are tobe used to create a new variable. To create the new variable “totpts” the compute dialog boxshould look like this:

Page 12: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

Notice you can click on the button “Type and Label… ” to define the variable just like you didabove. You can also use mathematical operations and special functions to help you definevariables. For example, we know there were 300 points possible in the class so I can figure outwhat percentage of 300 points every student earned. To do this calculation, we would use thecompute function and the dialog box would look like this:

The data window now shows the new variables we have computed. Notice the totper variablenow has two decimal places (done via the type and label button) because it is a percentage.

Recoding Variables in the Data Window

Recall in class we spoke about reversing the valence on scaled items to avoid response set. Wehave to remember to reverse the scaling of these items before data analysis. To rescale items orto reduce the number of categories (for example going from a measure of age at the ratio level toa measure of age by categories (young and old)) we use the recode command. To reverse the

Page 13: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

To recode a reverse valence Likert item with five points we would need to take a score of 5 andgive it a score of 1, a score of 4 a score of 2, a score of 2 a score of 4, and 1 to 5, three stays thesame as the middle point. The recode dialog box for this operation would look like:

Where you identify the variables to be recoded. It is possible to recode multiple variables at onetime. When you have selected the variables to be recoded (likert1), you then click Old and NewValues… to define the recode:

Page 14: Intro to SPSSonline.sfsu.edu/beca703/lecture/spss.1.pdf · Introduction to SPSS on the Macintosh. Scott Patterson,Ph.D. Broadcast and Electronic Communication Arts San Francisco State

You need to define each recode individually and “add” it to the list of recodes. When you aredone, you click continue and then OK to do the recodes. Remember to Save.

These are the basic steps you need to know for moving around the SPSS data window.Understanding the data set is the most difficult part of learning SPSS. We will spend significanttime learning how to construct and work with data files.