Guide to Using SPSS for Windows (11

65
Guide to Using SPSS for Windows (Ver. 15.0) Dr. Robert Gebotys 2007

Transcript of Guide to Using SPSS for Windows (11

Page 1: Guide to Using SPSS for Windows (11

Guide to Using SPSS for Windows (Ver. 15.0)

Dr. Robert Gebotys

2007

Page 2: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 2

Table of Contents Part One: Introduction __________________________________________________ 3

1.1 Accessing SPSS for Windows at Wilfrid Laurier University _____________________ 3

1.2 Starting a SPSS for Windows Session on the Novell Network____________________ 4

Part Two: Undertaking the Regression Procedure in SPSS for Windows __________ 8 2.1 Entering Data in the SPSS Data Editor Window_______________________________ 8

2.2 Saving and Printing the Data File __________________________________________ 14

2.3 Printing the Contents of the Data Editor ____________________________________ 16

2.4 Creating, Saving and Printing a Scatterplot _________________________________ 19

2.5 Specifying the Regression Procedure _______________________________________ 29

2.6 Running the Regression Procedure on SPSS _________________________________ 35

2.7 Saving and Printing the Syntax File ________________________________________ 37

2.8 Viewing the Output of the Regression Procedure _____________________________ 38

2.9 Saving and Printing the Regression Analysis from the SPSS Viewer Window______ 40

2.10 Retrieving, Saving and Printing the Expanded Data Matrix ___________________ 40

2.11 How to Exit SPSS for Windows and the Novell Network _____________________ 45

Part Three: Additional Procedures pertaining to the Quadratic Model ___________ 44 3.1 Data Transformation: Creating a New Variable from an Existing Variable_______ 46

3.2 Fitting a Quadratic Regression Curve on the Scatterplot ______________________ 46

3.3 Specifying the Regression Procedure for a Polynomial of Degree 2 ______________ 50

Part Four: Using SPSS for Windows to Implement the One-Way Analysis of Variance and Two-Way Analysis of Variance _______________________________________ 50

4.1 Using the Syntax Editor to Specify the One-Way ANOVA Procedure____________ 50

4.2 Using the SPSS Syntax Editor to Specify the Two-Way ANOVA Procedure ______ 51

Part Five: Using SPSS for Windows to Implement Reliability Analyses __________ 52 5.1 Conducting a Reliability Analysis using the Cronbach Alpha (α) Measure _______ 52

5.2 Conducting the Split-Half Reliability Analysis _______________________________ 58

5.2 Conducting the Even-Odd Reliability Analysis ______________________________ 59

Part Six: Using SPSS for Windows to Conduct Factor Analyses (i.e., tests of factorial validity) ______________________________________________________________ 60

6.1 Specifying the Factor Analysis Procedure___________________________________ 60

Revised Sept. 2007 Dr. Robert Gebotys

Page 3: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 3

Part One: Introduction This guide has been created for WLU Graduate Students as a companion to the notes Applied Linear Models and Experimental Design Using SPSS and SAS, written by Dr. Robert Gebotys. Focussing specifically on the application of SPSS for research in the social sciences, this guide will lead you step-by-step through the most frequently employed SPSS procedures using specific examples relevant to the course assignments. It should be noted that only a small proportion of all the procedures available in SPSS for Windows are outlined in this guide. Students are encouraged to consult additional sources (e.g., SPSS Manuals) if they are interested in learning more about the capabilities of SPSS for Windows.

Depending on your previous experience with statistical software in a Windows environment, you may find certain sections of this guide more relevant to your own learning needs than others. Nevertheless, you are encouraged to thoroughly read through all sections as they contain a number of suggestions and tips that pertain directly to your class assignments. 1.1 Accessing SPSS for Windows at Wilfrid Laurier University

SPSS is available on both the mainframe and the microcomputers. This handout

will describe how to use the microcomputer version of SPSS, or more specifically, SPSS 15.0 for Windows.

SPSS for Windows is available on the Novell Network and is accessible through most computers in the Psychology Department (i.e., those in the graduate student offices and those in the graduate student lounge). In addition, there are some computer labs located in the Science Building that provide access to SPSS for Windows (e.g., Room N1055), however these labs are often much busier as they are for the use of all WLU students.

To gain access to SPSS for Windows through the microcomputers, you need to

create a login and password on the network. Please refer to the Computing Services’ flyer for instructions on how to create your login and password on the Novell network.

Reader’s Tip: Work using SPSS for Windows can be made more convenient if a mouse is used. A mouse is a device connected to the computer that you can move with your hand to produce corresponding cursor movements on the screen. An arrow or pointer indicates the position of the cursor on the screen. There are three buttons on one end of the mouse. Selecting text or choosing an item from the screen is usually done by clicking the left button (i.e., depressing and releasing the left button rapidly). The term ‘clicking’ refers to the process whereby you use your mouse to move the pointer to a specified position on the screen and then rapidly depress and release the left button of the mouse once. ‘Double clicking’ means moving the pointer to a specified position and then rapidly depressing and releasing the left button of the mouse twice.

Revised Sept. 2007 Dr. Robert Gebotys

Page 4: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 4

1.2 Starting a SPSS for Windows Session on the Novell Network

You will begin your Windows session by first turning on the computer and

waiting until the Windows desktop appears (i.e., a screen filled with a number of pictures or graphics, called icons). Examine the screen to see if there is an icon with the letters “SPSS” written beneath it. If there is such an icon, double click on the icon to open the SPSS software. If there is no icon for SPSS visible on the screen you will need to click on the Start button located at the bottom left-hand corner of the screen. A menu will appear with a number of options listed. Using the mouse, scroll the pointer up to Programs and wait until another much larger submenu appears. This submenu is an alphabetical list of the software programs available to the computer user. If SPSS is available on the computer it will be listed in this submenu. To select SPSS from this submenu, simply click on “SPSS 15.0 for Windows” and the SPSS software will open (note that this may take a few seconds).

Reader’s Tip: During the time that the computer is “thinking” or undertaking a task, the pointer typically stops blinking and takes on the form of an hour glass or a plus sign (+). You may also hear some soft clicking or humming sounds coming from the computer. It is recommended that you not use the mouse or press any keys while this is taking place. Simply wait until the pointer returns to the screen and then proceed with your work.

Revised Sept. 2007 Dr. Robert Gebotys

Page 5: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 5

When you first enter SPSS for Windows a box will appear with a number of options for you to begin your session. The box should appear similar to the one below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 6: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 6

Beside each option there is a radio button (i.e., hollow circle); a single click on the radio button will select that option (i.e., circle will be filled). A single click on the OK command push button will allow you to proceed to the selected option. Because you will begin most sessions in SPSS by entering data, click on the Type in data option (i.e., make sure that the radio button is filled) and then click OK. This will then open an SPSS Data Editor window similar to the one below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 7: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 7

SPSS Note: SPSS for Windows is menu driven. Most of the features are accessed by making selections from the menus. The horizontal bar in the SPSS Data Editor window, which contains File, Edit, . . . and Help menus is the main menu bar (i.e., this bar contains 10 menus). In addition to the Data Editor Window there are two other windows in SPSS: the SPSS Viewer Window and the SPSS Syntax Window. These other windows also provide different menus for creating and editing charts as well as undertaking other analyses. These menus will replace the main menu bar if the new window is the active window. All the different windows in SPSS have some common features. On the top left-hand corner of each window is a control button (looks like a mini SPSS icon) that, when clicked, will list a number of options such as restoring, moving, minimizing, etc., the window. On the top-right corner of each window are three additional

buttons. The first button (small line ‘__’) minimizes the screen, the second button (overlapping windows) changes the size of the active window, and the third button (an ‘X’) closes the window.

Revised Sept. 2007 Dr. Robert Gebotys

Page 8: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 8

Part Two: Undertaking the Regression Procedure in SPSS for Windows

2.1 Entering Data in the SPSS Data Editor Window The Data View (tab located at the bottom left hand side) provides a convenient spreadsheet-like facility for entering, editing, and displaying the contents of your data file. In the Data View, the rows are the cases and the columns are the variables. There are numerous cells in the Data View and each cell is the intersection of a case and a variable. Each cell is supposed to contain a single value of a variable for a case. A blank Data View window should look like this:

Revised Sept. 2007 Dr. Robert Gebotys

Page 9: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 9

In the Variable View (tab located at the bottom left hand side) you are able to

define various properties for your variables. Each row constitutes a single variable. Please note that you can move between the Data View and the Variable View windows freely without affecting the data. A blank Variable View window should look like this:

Revised Sept. 2007 Dr. Robert Gebotys

Page 10: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 10

For this procedure we will use the data from the age and crime example as

outlined below. The researcher wishes to see how age and a crime seriousness measure are related.

AGE CRIME SERIOUSNESS

20 21 25 28 26 27 25 26 30 33 34 36 40 31 40 35 40 41 80 95

Revised Sept. 2007 Dr. Robert Gebotys

Page 11: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 11

To name the first variable as “age” simply type age in the first cell under Name. Please note that a variable name cannot exceed sixty-four characters and that each variable must be unique (i.e., duplication is not allowed). To name the second variable “crime” simply repeat the procedure in the cell beneath “age”.

The default for Type is Numeric, and the Width is 8, which means that the valid values will contain 8 spaces. Also, note that the default for Decimals is set at 2. Since decimal spaces are unnecessary for the “age” and “crime” variables, we shall change the default. In Variable View, click in the Decimals column of the corresponding variable (i.e. “age” or “crime”), as shown below. Then select “0” decimal places by using the arrows in the cell. You may also insert a detailed label under the Label column. The “age” variable was given the label “age in years” as shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 12: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 12

You are now ready to enter your data. To do so, you need to exit from your

Variable View to the Data View. The Data View is now ready for entering values for the ‘age’ variable. To enter the first value on the list (i.e., 20), first type 20. The value ‘20’ will then be displayed in the cell editor at the top of the Data View. Make corrections if necessary and when the entry is as you want it press the ‘Enter’ key on the keyboard. The value ‘20’ is then entered into the Data Editor and appears in the first cell under the ‘age’ column. Repeat the above procedures for the second value on the list (i.e., ‘25’), that is type 25 followed by pressing the ‘Enter’ key. Use the same procedures to enter the remaining 8 values for the ‘Age’ variable according to the order listed in the table of values. Please note that if you find, after pressing the ‘Enter’ key, that you have made a mistake in entering the data, you can make the correction by simply clicking on the cell where a mistake was made, then type the correct number and press ‘Enter’. To create a second variable, return to the Variable View spreadsheet and click the first cell of the second row under Name in the Variable View. Instead of typing ‘age’, type crime this time because we want to create the variable ‘crime seriousness’. Repeat the same procedures for modifying the ‘Variable Type’, so that “Type:’ once again reads ‘Numeric8.0’. Since the variable name ‘crime’ does not convey much meaning, we may want to add a variable label to this variable. To do this, first click on the second cell under ‘Labels . . .’ and type Crime Seriousness. The label ‘Crime Seriousness’ is then entered into the Variable Label text box. At this stage, return to the Data View and enter in your data for the crime variable. Use exactly the same procedures for entering the 10 values for the ‘crime’ variable as you used to enter the values for the ‘age’ variable; that is, type 21 and then press the ‘Enter’ key, followed by typing 28 and pressing the ‘Enter’ key, and so on, until ‘95’ has been entered into the tenth cell of the ‘serious’ column in the Data Editor.

Revised Sept. 2007 Dr. Robert Gebotys

Page 13: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 13

The active Data Editor window should now resemble the one below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 14: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 14

2.2 Saving and Printing the Data File Once you have entered the complete data set into the Data Editor, in this case 10 pairs of values, it is recommended that you save the data matrix. The following steps outline how to save the content of the Data Editor: 1. Insert a formatted 3.5 in diskette into drive A of the computer. 2. Click File on the main menu bar and then click ‘Save As . . .’ in the File menu.

This will activate a ‘: Save Data As’ dialog box, similar to that shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 15: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 15

3. Decide on a file name. It is customarily, though not absolutely necessary, that the extension of the file name be ‘. sav.’ This extension is used because any file with an extension of ‘.sav’ is assumed to be a data file in SPSS format. Note that the default file extension in SPSS is ‘.sav.’ For illustrative purposes, we would assign the name ‘crime.sav’ to this data file.

4. Type your file name, e.g., crime.sav, into the File name text box of the Save Data As dialog box.

5. Click the downward pointing arrow to the right of the Save in text box. A list of drive locations and folder names will appear. The next step is to move your cursor along the drop-down list of available drives until you locate ‘3.5 Floppy [A:]’.

Revised Sept. 2007 Dr. Robert Gebotys

Page 16: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 16

Click on this option and you will immediately see that the drive location in the Save in text box has been changed to ‘3.5 Floppy [A:]’. As well, in the text box below you will see a list of the files already saved to your floppy disk. (Note: this text box will be blank if you have not previously saved files to the floppy.)

6. Click the Save command pushbutton located along the right margin of the ‘Save Data As’ dialog box. This will instruct the computer to save the content of the Data Editor into your diskette at drive A under the filename ‘crime.sav’. At this point, the dialog box has disappeared and you should be able to see some changes in the Data Editor (i.e., the title at the top of the screen should now read “crime – SPSS Data Editor”).

2.3 Printing the Contents of the Data Editor After you have saved the contents of the Data Editor to your floppy diskette, it may be appropriate to print the contents of the Data Editor so that you have a hard copy (i.e., a printout) to which to refer. The following instructions outline how to print your data: 1. Click File on the main menu bar and click ‘Print …’ in the File menu. A ‘Print’

dialog box should appear on you screen, similar to the one shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 17: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 17

2. The first thing you should check is if the radio button next to All is filled; if not,

single click on that radio button to select the ‘All’ option. 3. Check to see that the printer listed in the ‘Name’ text box is the printer to which

you want your data sent. If it is not the correct printer, click on the downward arrow to the right of the text box and then click on the name of the alternative printer you prefer. You should immediately see the name of the new printer listed in the Name text box.

4. Next, click on the ‘Properties. . .’ pushbutton located at the upper left corner of the dialog box. This will open a ‘Document Properties’ sub-dialog box similar to the one below (note that the printer options will be different).

Revised Sept. 2007 Dr. Robert Gebotys

Page 18: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 18

5. In SPSS the default orientation for printouts is portrait format (i.e., length-wise on

the paper). In cases where you have large sets of data it may be desirable to print your data matrix in landscape format (i.e., width-wise on paper) instead of in portrait format. If you wish to select landscape orientation, use your mouse-guided pointer to fill in (i.e., single click) the radio button to the left of the ‘Landscape’ command in the “Orientation” sub-dialog box.

6. Click the OK command pushbutton at the bottom of the “Document Properties” dialog box, which will return you to the Print dialog box. To begin printing click the OK command pushbutton.

After you have completed step 6, the computer should then produce a message telling you that the file is being sent to the designated printer for printing. If in any event you wish to cancel this print job, click the ‘Cancel’ pushbutton. If you decide to proceed with the print job, do nothing. However, you must wait until the printing is spooled (message will appear on the screen) before you logout or turn off the computer, otherwise, the print job will fail (i.e., it will not be printed).

Revised Sept. 2007 Dr. Robert Gebotys

Page 19: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 19

2.4 Creating, Saving and Printing a Scatterplot The following are the steps needed to create a scatterplot for the data on age and crime seriousness. 1. Click Graphs on the main menu bar. 2. Click ‘Chart Builder…’ in the Graphs menu, which will open a Chart Builder

dialog box identical to that below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 20: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 20

3. Select the ‘Scatter/Dot’ option from the “Choose from” sub-dialog box, and then double-click on the ‘Simple Scatter’ icon.

4. Step 3 will open a template of a simple scatterplot in the “Chart Preview” sub-dialog box.

5. Since ‘age’ is the independent variable, it should be placed on the X-axis of the scatterplot. To define the X-axis as ‘age’, click ‘age’ in the box containing the variable list and drag it onto the ‘X-Axis’ label in the “Chart Preview” sub-dialog box.

6. To define the Y-axis as ‘crime seriousness’, select ‘serious’ in the box containing the variable list. Then drag the cursor onto the ‘Y-Axis’ label in the “Chart Preview” sub-dialog box. The immediate visual effect of steps 5 and 6 is that ‘age’ and ‘serious’ have been entered into the X-axis box and Y-axis box respectively. The Chart Builder dialog box should now resemble the one below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 21: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 21

7. Click the OK command pushbutton located at the bottom left-hand corner of the

dialog box. The result of step 6 is the opening of a SPSS Viewer window. The SPSS Viewer window consists of two panes: the outline pane and the results pane. The outline pane is located on the left and looks like a table of contents. The results pane is located on the right and contains the actual output (e.g., charts, graphs, etc.) If you click on one of the items in the outline pane it will appear in results pane with a box around it, showing that it is the active object (i.e., and can be modified, etc). You will note that the basic scatterplot of age versus crime seriousness is already displayed in the results window, similar to that shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 22: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 22

8. In order to do some editing of the basic scatterplot (i.e., fitting the least-squares regression line, assigning a more appropriate title to the plot, etc.), the first step is to highlight the scatterplot of age vs. crime and then click ‘Edit’ on the menu bar. Scroll to the bottom of the menu and select “SPSS Chart Object” and then select “Open” (i.e., select these options using single clicks). This series of commands will then open a SPSS Chart Editor window that contains a new icon bar and a new menu bar. Nevertheless, the original basic scatterplot is reproduced in full in the new window.

Revised Sept. 2007 Dr. Robert Gebotys

Page 23: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 23

9. To plot the least-squares regression line, click once on a point that is plotted on

the graph. This should cause all the points to turn blue. On the toolbar at the top of the page, click on Elements, and select Fit line at Total.

10. A Properties box will appear. Select Linear. Then click on the Close button.

Revised Sept. 2007 Dr. Robert Gebotys

Page 24: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 24

11. Your graph should have a line through the middle of all the points like the graph

below. Close the Chart editor and return to output file.

Revised Sept. 2007 Dr. Robert Gebotys

Page 25: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 25

12. To give a proper title to the scatterplot, click Options in the menu bar followed by

clicking ‘Title…’ in the Options menu. A text box should appear in the Chart Editor above the scatterplot. Delete Title and type in the words Scatterplot of Age vs. Crime Seriousness.

13. Note that a Properties box will appear when you attempt to create a title. Under the “Text Layout” menu, click the arrow button in the box below ‘Justify’. A choice of nine justifications is unfolded. Click the ‘Center’ icon in the middle of all the other options. The purpose of this step is to instruct the software to place the title at the centre of the page. The Properties box should now be identical to that shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 26: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 26

14. Click the Close command pushbutton in the Properties box. At this stage, the scatterplot is complete with a least-squares regression line and an appropriate title.

15. Click the pushbutton marked “X” at the top right-hand corner of the Chart Editor window to return to the SPSS Viewer window. It should be apparent that all changes to the scatterplot that you made in the Chart Editor have also been made to the scatterplot in the results pane of the SPSS Viewer window.

It is now advisable that you save the chart (i.e., the scatterplot) before proceeding with any other tasks. The following outlines the procedures for saving the chart. 1. Insert a 3.5 in diskette into drive A. 2. Click File on the main menu bar and then click ‘Save As . . .’ in the File menu.

This will activate a “Save As” dialog box, similar to that shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 27: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 27

3. Decide on a file name. Note that the default file extension for SPSS Viewer files

is “*.spo”. To denote that this is a chart file you might want to name your file “crimecht.spo”.

4. Type your file name, e.g., crimecht.spo, into the File name text box of the Save Data As dialog box.

5. Click the downward pointing arrow to the right of the Save in text box. A list of drive locations and folder names will appear. The next step is to move your cursor along the drop-down list of available drives until you locate ‘3.5 Floppy [A:]’. Click on this option and you will immediately see that the drive location in the Save in text box has been changed to ‘3.5 Floppy [A:]’. As well, in the text box below you will see a list of the files already saved to your floppy disk. (Note: this text box will be blank if you have not previously saved files to the floppy.)

6. Click the Save command pushbutton located along the right margin of the ‘Save As’ dialog box. This will instruct the computer to save the content of SPSS Viewer window into your diskette at drive A under the filename ‘crimecht.spo’. At this point, the dialog box has disappeared and you should be able to see some changes in the SPSS Viewer window (i.e., the title at the top of the screen should now read “crimecht – SPSS Viewer”).

To print this scatterplot, proceed with the following:

1. Click File on the main menu bar and click ‘Print …’ in the File menu. This will open a Print dialog box, similar to that shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 28: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 28

2. Check to see which printer is listed in the Printer box in the ‘Name’ text box to

see if it matches the printer to which you want your SPSS Viewer file routed. If this is not the printer you want your file routed to, click on the downward arrow to the right of the text box and then click on the name of the alternative printer you prefer. The name of the new printer should now appear in the text box.

3. Check to see if the radio button (i.e., hollow circle) to the left of ‘All visible output’ is selected in the Print range box located at the lower left-hand side of the Print dialog box. If it is not filled use a single click to select ‘All’.

4. Click the OK command pushbutton at the bottom of the Print dialog box to begin printing.

As in the case of printing the data file, the computer should then produce a

message telling you that the SPSS Viewer file is being sent to the designated printer for printing. If in any event you wish to cancel this print job, click the ‘Cancel’ pushbutton. If you decide to proceed with the print job, do nothing. However, you must wait until the printing is spooled (message will appear on the screen) before you logout or turn off the computer, otherwise, the print job will fail (i.e., it will not be printed).

Revised Sept. 2007 Dr. Robert Gebotys

Page 29: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 29

2.5 Specifying the Regression Procedure

After viewing what the scatterplot looks like, the next step will be to conduct a regression analysis on this set of data. This procedure can be executed from within the SPSS Viewer window. Perform the following steps in order to produce output that is similar to that shown on page 118 of the course text: 1. Click Analyze on the main menu bar. 2. Click Regression on the Statistics menu. 3. Click Linear . . . in the Regression submenu. This will open a Linear Regression

dialog box similar to the one shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 30: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 30

4. The next step is to specify which is the independent variable and which is the

dependent variable. In this example, ‘age’ is the independent variable and ‘crime seriousness’ is the dependent variable. To specify ‘age’ as the independent variable, simply click the arrow button to the left of the ‘Independent[s]:’ text box. ‘Age’ is then entered into that text box. Finally, to specify ‘serious’ as the dependent variable, go to the variable source list and click ‘serious’ and then click the arrow button to the left of the ‘Dependent:’ text box.

The commands for the basic regression procedure have been defined through the above-mentioned four steps. If SPSS for Windows was instructed to run the regression analysis at this stage (i.e., through clicking the “OK” command pushbutton in the dialog box), it should produce an output exactly identical to that shown on page 118 of the course text. However, if you also want to include other statistics like the Confidence Interval for the slope and the constant, as well as the Durbin-Watson test results, etc., you have to do the following.

1. Click the ‘Statistics…’ pushbutton at the bottom of the Linear Regression dialog box. This will open a Linear Regression: Statistics dialog box like the one shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 31: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 31

2. If you want to include the confidence intervals for the two parameters (that is, for

the slope and the constant), click the check box to the left of ‘Confidence Intervals.’

3. If you also need the Durbin-Watson results, click the check box to the left of ‘Durbin-Watson.’

4. To instruct SPSS for Windows to produce the table of Casewise diagnostics, click the check box adjacent to ‘Casewise diagnostics’ towards the bottom of the dialog box and then click the radio button adjacent to ‘All cases’ until the centre of the radio button is filled.

5. After all these steps are completed, click the Continue command pushbutton to register these instructions/commands and to return to the Linear Regression dialog box.

To instruct SPSS for Windows to produce the three charts as shown on pages 123-

124 of the course text (i.e., Histogram of Standardized Residual, Normal Probability (P-P) Plot of Standardized Residual, and Plot of Standardized Predicted vs. Standardized Residual), you need to go to the “Linear Regression: Plots” dialog box. The steps which enable us to obtain the above mentioned plots are as follows: 1. Click the ‘Plots…’ pushbutton located at the bottom of the Linear regression

dialog box. This will open a “Linear Regression: Plots” dialog box, as shown below:

Revised Sept. 2007 Dr. Robert Gebotys

Page 32: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 32

2. To instruct SPSS for Windows to produce the Histogram and the Normal

Probability Plot of the Standardized Residuals, click the two check boxes adjacent to ‘Histogram’ and ‘Normal probability plot’ within the ‘Standardized Residual Plots’ box at the bottom of the dialog box.

3. To produce the Plot of Standardized Predicted Value vs. Standardized Residual first click *ZRESID in the variable list box near the top left corner of the dialog box, then click the arrow pushbutton to the left of Y (i.e., standardized residual is now on the Y-axis. Next, click *ZPRED in the variable list box, then click the arrow pushbutton to the left of X (i.e., standardized predicted value should now be presented on the X-axis).

4. Finally, click the Continue command pushbutton to register all these commands. The Linear Regression: Plots dialog box will then disappear and the Linear Regression dialog box will reappear on the screen.

Revised Sept. 2007 Dr. Robert Gebotys

Page 33: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 33

SPSS for Windows will not produce the Residuals Statistics shown on page 121 of the course text by default. The following steps outline how to instruct SPSS for Windows to produce summary statistics for the residuals. 1. Click the ‘Save…’ pushbutton located at the bottom of the Linear Regression

Dialog box. This will open a “Linear Regression: Save New Variables” dialog box like the one shown below:

2. Click all the check boxes within all the following three boxes in the dialog box,

namely: Predicted Values; Distances; and Residuals. 3. Click the Continue command pushbutton to register these choices and to return to

the Linear Regression dialog box.

Revised Sept. 2007 Dr. Robert Gebotys

Page 34: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 34

Your output of the residuals statistics should resemble the output shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 35: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 35

2.6 Running the Regression Procedure on SPSS There are TWO ways of instructing SPSS for Windows to run the above regression procedure selections. Method 1: Simply click the Ok command pushbutton in the Linear Regression dialog box. Or, alternatively . . .

Method 2: By utilizing the Run command in a SPSS Syntax window. That is, the selections you have made in the Linear Regression dialog boxes are actually commands for the regression procedure. You can click the Paste command pushbutton in the Linear Regression dialog box to paste this underlying command syntax into a Syntax window (i.e., a syntax window will be opened when the Paste command is clicked and the selections that you have made are reproduced in this window in the format of a command syntax or SPSS programming language).

Revised Sept. 2007 Dr. Robert Gebotys

Page 36: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 36

The Syntax window should resemble the following:

One of the advantages of pasting your dialog box selections into a Syntax window is that you can then edit the resulting text and run the modified commands. Simply click the Run command on the Syntax window menu bar to open the Run submenu. Four options will appear (i.e., All, Selection, Current, and To End) from which you select ‘All’ with a single click on that option. By selecting All, SPSS will execute the entire command syntax as listed in the SPSS Syntax window. If no modifications have been made to the previously created regression command syntax, the outputs obtained from running the commands in the Syntax window will be exactly identical to those obtained from using Method 1 (i.e., clicking the OK command pushbutton in the Linear Regression dialog box).

Revised Sept. 2007 Dr. Robert Gebotys

Page 37: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 37

2.7 Saving and Printing the Syntax File (*this applies ONLY if you used Method 2 to run the regression procedure) If you have already pasted your dialog box selections into a Syntax window, it may be a good idea to save and even print the command syntax before instructing SPSS to run the regression analysis. Follow the steps below if you want to save the content of the Syntax window (make sure that you diskette is in drive A). 1. Click File on the main menu bar and then click ‘Save As . . .’ in the File menu.

This will activate a “Save As” dialog box. 2. Decide on a file name. Note that the default file extension for SPSS Syntax files

is “*.sps”. To denote that this is a syntax file you might want to name your file “crime.sps” or “crimesyn.sps”.

3. Type your file name, e.g., crime.sps, into the File name text box of the Save Data As dialog box.

4. Click the downward pointing arrow to the right of the Save in text box. A list of drive locations and folder names will appear. The next step is to move your cursor along the drop-down list of available drives until you locate ‘3.5 Floppy [A:]’. Click on this option and you will immediately see that the drive location in the Save in text box has been changed to ‘3.5 Floppy [A:]’. As well, in the text box below you will see a list of the files already saved to your floppy disk. (Note: this text box will be blank if you have not previously saved files to the floppy.)

5. Click the Save command pushbutton located along the right margin of the ‘Save As’ dialog box. This will instruct the computer to save the content of the Syntax Editor into your diskette at drive A under the filename ‘crime.sps’. At this point, the dialog box has disappeared and you should be able to see some changes in the Syntax Editor window (i.e., the title at the top of the screen should now read “crime – SPSS Syntax Editor”).

In order to Print the contents of the syntax window complete the following steps: 5. Click File on the menu bar and click ‘Print …’ in the File menu. 6. Check to see which printer is listed in the Printer box in the ‘Name’ text box to

see if it matches the printer to which you want your Syntax file routed. If this is not the printer you want your data routed to, click on the downward arrow to the right of the text box and then click on the name of the alternative printer you prefer. The name of the new printer should now appear in the text box.

7. Check to see if the radio button (i.e., hollow circle) to the left of ‘All’ is selected in the Print range box located at the lower left-hand side of the Print dialog box. If it is not filled use a single click to select ‘All’.

8. Click the OK command pushbutton at the bottom of the Print dialog box to begin printing. Remember not to logout or turn off the computer until the printing is spooled.

Revised Sept. 2007 Dr. Robert Gebotys

Page 38: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 38

2.8 Viewing the Output of the Regression Procedure The output of the regression analysis you instructed SPSS for Windows to perform (using either Method 1 or Method 2) will appear in a SPSS Viewer window. As you will recall from section 2.4, the SPSS Viewer window consists of two panes: the Outline pane, and the Results pane. The Outline pane located along the left-hand side of the window looks like a table of contents as it includes a list of all the output in the Results pane. The Results pane contains the actual output all of procedures undertaken during the SPSS session. You will notice that not all of the output is visible in the Results pane. You have two options for viewing the contents of the Results pane: (1) you can scroll through the contents of the pane using the vertical scroll bar located at the right-hand side of the Results pane (i.e., click on the arrows to move up or down through the pane); or (2) you can click on the item you wish to view in the Outline pane and it will appear in the Results pane.

Revised Sept. 2007 Dr. Robert Gebotys

Page 39: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 39

For this Regression analysis, the output should appear in the following order: 1. Tables pertaining to the basic regression analysis (e.g., model summary, Beta

values, etc). 2. Table of Casewise Diagnostics. 3. Table of Residual Statistics. 4. Histogram of Standardized Residuals 5. Normal Probability Plot. 6. Scatterplot of Standardized Predicted Values vs. Standardized Residuals. The Regression analysis will be reproduced in full once you have run the program in the aforementioned order.

Revised Sept. 2007 Dr. Robert Gebotys

Page 40: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 40

Graph Scatterplot of Age vs Crime

Age in months

908070605040302010

crim

e100

80

60

40

20

Regression

Variables Entered/Removedb

Age inmonths

a . Enter

Model1

VariablesEntered

VariablesRemoved Method

All requested variables entered.a.

Dependent Variable: crimeb.

Model Summaryb

.970a .940 .933 5.46 1.040Model1

R R SquareAdjustedR Square

Std. Error ofthe Estimate

Durbin-Watson

Predictors: (Constant), Age in monthsa.

Dependent Variable: crimeb.

ANOVAb

3755.547 1 3755.547 125.944 .000a

238.553 8 29.8193994.100 9

RegressionResidualTotal

Model1

Sum ofSquares df Mean Square F Sig.

Predictors: (Constant), Age in monthsa.

Dependent Variable: crimeb.

Revised Sept. 2007 Dr. Robert Gebotys

Page 41: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 41

Coefficientsa

-5.785 4.210 -1.374 .2071.197 .107 .970 11.222 .000

(Constant)Age in months

Model1

B Std. Error

UnstandardizedCoefficients

Beta

Standardized

Coefficients

t Sig.

Dependent Variable: crimea.

Residuals Statisticsa

18.15 89.96 37.30 20.43 10-.937 2.578 .000 1.000 10

1.74 5.00 2.25 .99 10

17.45 63.81 34.67 13.77 10-11.09 5.04 2.84E-15 5.15 10-2.030 .923 .000 .943 10-2.147 2.296 .138 1.209 10-12.40 31.19 2.63 11.43 10-3.087 3.678 .162 1.713 10

.014 6.645 .900 2.036 10

.003 13.673 1.420 4.306 10

.002 .738 .100 .226 10

Predicted ValueStd. Predicted ValueStandard Error ofPredicted ValueAdjusted Predicted ValueResidualStd. ResidualStud. ResidualDeleted ResidualStud. Deleted ResidualMahal. DistanceCook's DistanceCentered Leverage Value

Minimum Maximum Mean Std. Deviation N

Dependent Variable: crimea.

Charts Scatterplot

Dependent Variable: crime

Regression Standardized Predicted Value

3.02.52.01.51.0.50.0-.5-1.0

Reg

ress

ion

Sta

ndar

dize

d R

esid

ual

1.0

.5

0.0

-.5

-1.0

-1.5

-2.0

-2.5

Revised Sept. 2007 Dr. Robert Gebotys

Page 42: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 42

2.9 Saving and Printing the Regression Analysis from the SPSS Viewer Window At this stage it is appropriate to save and print the contents of the SPSS Viewer window. The steps that you take to save and print the Regression analysis are identical to the steps taken to save and print the initial Scatterplot, as outlined in section 2.4 of this guide (i.e., because they are both contained within SPSS Viewer windows). Because you may have named your initial scatterplot ‘crime.spo’, you may opt to name your new file ‘crimereg.spo’ to denote that it includes a regression analysis. Whatever file names you choose make sure that you do not choose the same name for the second file as for the first (or SPSS will copy over your initial file and you will lose that information). Also, try to choose file names that are meaningful should you need to locate the files at a later date (i.e., it will make it easier to recognize and retrieve relevant files).

SPSS Tip: When working within an SPSS Viewer window there may be times when the output from a number of analyses are included in the Results pane; you may not want to print the entire contents of the Results pane, however. In order to select only certain items to print, click on those items in the Outline pane (so that they appear with a grey background). Then when you select Print from the main menu be sure that the radio button next to ‘Selection’ in the Print range box of the Print dialog box is filled.

2.10 Retrieving, Saving and Printing the Expanded Data Matrix As a result of the regression procedures undertaken according to the aforementioned instructions, a number of new variables, all of which are residual statistics, have been created and added to the original data matrix. To view this expanded data matrix we need to make the Data Editor the active window. We can switch to the Data Editor by clicking on the Window command on the main menu bar and clicking on the appropriate file in the Window submenu, in this case “crime.sav [DataSet1] – SPSS Data Editor.”

SPSS Tip: By using the Window command located on the menu bar, you can easily switch between active windows without having to open and close those windows each time you want to switch. This feature saves you time and allows you to work on different tasks/procedures during a single SPSS session.

Revised Sept. 2007 Dr. Robert Gebotys

Page 43: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 43

Examining the data matrix in the Data Editor, you should immediately notice that more variables have been added to the original data matrix, which previously only contained two variables. To view the new variables, use the horizontal and vertical scroll bars as well as the arrow buttons located at each end of the scroll bars to move throughout the Data Editor window.

Revised Sept. 2007 Dr. Robert Gebotys

Page 44: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 44

The following procedures outline how to save this expanded data matrix to your diskette. These instructions are essentially the same as those used for saving the previous data file. 1. Insert a formatted 3.5 in diskette into drive A. 2. Click File on the main menu bar and then click ‘Save As . . .’ in the File menu.

This will activate a “: Save Data As” dialog box. 3. Decide on a file name. Because you likely named the original data file

“crime.sav,” it is recommended that you name the expanded file “crime2.sav”. 4. Type your file name, e.g., crime2.sav, into the File name text box of the Save

Data As dialog box. 5. Click the downward pointing arrow to the right of the Save in text box. A list of

drive locations and folder names will appear. The next step is to move your cursor along the drop-down list of available drives until you locate ‘3.5 Floppy [A:]’. Click on this option and you will immediately see that the drive location in the Save in text box has been changed to ‘3.5 Floppy [A:]’. As well, in the text box below you will see a list of the files already saved to your floppy disk. (Note: this text box will contain the name of your other data file, crime.sav, if you are using the same diskette.)

6. Click the Save command pushbutton located along the right margin of the ‘Save Data As’ dialog box. This will instruct the computer to save the content of the Data Editor into your diskette at drive A under the filename ‘crime2.sav’. At this point, the dialog box has disappeared and you should be able to see some changes in the Data Editor (i.e., the title at the top of the screen should now read “crime2 – SPSS Data Editor”).

After you have saved the contents of the Data Editor to your floppy diskette, it may be appropriate to print the contents of the Data Editor so that you have a hard copy (i.e., a printout) to which to refer. The following instructions outline how to print your data: 7. Click File on the main menu bar and click ‘Print …’ in the File menu. 8. When the “Print” dialog box appears on the screen, make sure that the radio

button (i.e., hollow circle) to the left of ‘All’ is filled. If it is not use the mouse to move the pointer over that radio button and use a single click to select ‘All’.

9. Check the printer that your data will be routed to by examining what is listed in the ‘Print’ text box. If this is not the printer you want your data routed to, click on the downward arrow to the right of the text box and then click on the name of the alternative printer you prefer.

Revised Sept. 2007 Dr. Robert Gebotys

Page 45: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 45

10. Next, click on the ‘Properties’ pushbutton in the “Print” dialog box. This will open a “Document Properties” sub-dialog box. In SPSS, the default orientation for printouts is portrait format (i.e., length-wise on the paper). In cases where you have large sets of data it may be desirable to print your data matrix in landscape format (i.e., width-wise on paper) instead of in portrait format. If you wish to select landscape orientation, use your mouse-guided pointer to fill in (i.e., single click) the radio button to the left of the ‘Landscape’ command in the Print Setup sub-dialog box. Click OK to register these choices and to return to the Print dialog box.

11. Click the OK command pushbutton at the bottom of the “Print” dialog box to begin printing.

2.11 How to Exit SPSS for Windows and the Novell Network You have now completed the basic regression analysis. Once you have completed your SPSS session, use the following steps to exit SPSS and the Novell network: 1. Click File on the main menu bar. 2. Click ‘Exit’ in the File menu. Please note that if you have not saved parts of your

previous work, the computer will at this point ask whether you want to save those. You can enter your instructions by simply clicking the appropriate command pushbuttons, namely, ‘Yes’, ‘No’, or ‘Cancel’.

3. After a few seconds the Windows desktop will reappear. Click on the Start command pushbutton at the lower left-hand corner of the screen. Click on “Shut Down…” which is located at the bottom on the Start menu. A dialog box will appear with a number of options. If you want to shut down the computer entirely (i.e., no one else is waiting to use the computer) choose the ‘Shut down the computer’ option by clicking on the appropriate radio button. Once you have made your selection, click the Yes command pushbutton. Your SPSS 15.0 Session is now complete.

Revised Sept. 2007 Dr. Robert Gebotys

Page 46: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 46

Part Three: Additional Procedures pertaining to the Quadratic Model

This section will cover additional procedures that are required to fit the model E(y⏐x) = β1 + β2x + β3x2 to Gebotys’ data on age and crime seriousness. The additional procedures covered in this section include: 1. How to create a new variable “age squared” (or “ agesq”), the values of which are

computed from squaring the values of the variable “age”; 2. How to fit a quadratic regression curve to the data points on the scatterplot of age

vs. crime seriousness; and 3. Modifications required in specifying the regression procedure for fitting a

polynomial model of degree 2. 3.1 Data Transformation: Creating a New Variable from an Existing Variable Before any data transformation can be done, the active Data Editor window must contain the 10 pairs of values on age and crime seriousness. There are TWO ways of obtaining this active Data Editor Window: 1. Enter the 10 pairs of values on age and crime seriousness following exactly the

same procedures described in Section 2.1 of this guide; OR 2. If you have saved this set of data on age and crime seriousness in a data file (e.g.,

under the file name “crime.sav”) on a diskette, you can retrieve this file by doing the following: • Insert the diskette into drive A • When the SPSS processor is ready for use, click on the “Open an existing

data source” option in the ‘SPSS for Windows’ introductory dialog box and then click OK, which will open an “Open Data” dialog box

• Click the downward pointing arrow to the right of the “Look in:” text box and select 3.5 Floppy [A:] from the list with a single click; you choice should then appear in the text box

• In the box below the “Look in” text box, you should see a list of the files on your floppy diskette; select the file you want to open by clicking on the name of the file (e.g., crime.sav)

• Click the Open command pushbutton in order to open the age and crime seriousness data file in a Data Editor window.

When the Data Viewer window is ready, follow the procedures below to create a new variable, “agesq”: 1. Click Transform on the main menu bar. 2. Click “Compute Variable…” in the Transform menu. This will open a

Computer Variable dialog box similar to the one shown below. Note that the two

Revised Sept. 2007 Dr. Robert Gebotys

Page 47: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 47

variables ‘age’ and ‘crime seriousness’ are already listed within the variable source list in your dialog box.

3. To create a new variable ‘agesq’, which is computed by squaring ‘age’ (i.e.,

squaring the value of age), do the following: • Type agesq in the Target Variable text box, located at the top left corner of the

Compute Variable dialog box, to specify the new variable that you are creating

• To specify the numeric expression of ‘agesq’ (that is, the squaring of ‘age’), click ‘age’ in the variable source list and click the arrow button to the right of the variable source list box. Then click the ‘**’ button on the lower right-hand side of the on-screen key pad followed by clicking the ‘2’ button on the key pad. As a result of the above steps, the expression “age**2” will be entered into the Numeric Expression box.

Revised Sept. 2007 Dr. Robert Gebotys

Page 48: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 48

4. Click the OK command pushbutton of the dialog box. You will immediately see

that a new variable, ‘agesq’, has been entered into the Data Editor.

5. At this stage, you may save the data matrix on a diskette, for example, under the

file name “crimeag2.sav”.

Revised Sept. 2007 Dr. Robert Gebotys

Page 49: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 49

3.2 Fitting a Quadratic Regression Curve on the Scatterplot 1. Start by creating a scatterplot for the set of data on age and crime seriousness, as

is outlined in section 2.4 of this guide. (Your scatterplot will appear in a SPSS Viewer window.)

2. To fit a quadratic regression curve, start by clicking on the scatterplot as it appears in the Results pane of the SPSS viewer window so that a thin black line surrounds the scatterplot. Next, click on Edit on the menu bar and select SPSS Chart Object from the Edit menu, followed by clicking Open on the submenu. This series of clicks will open a SPSS Chart Editor window. The scatterplot you have produced will appear in the Chart Editor window.

3. Click Elements on the Chart Editor window menu bar, followed by clicking ‘Fit line at Total’ in the Elements menu. This will open a Properties dialog box as shown below.

4. Click the check box to the left of the Quadratic in the ‘Fit Method’ box, and then

click the close command pushbutton. After a few seconds, you should see that a curve has already been fit to the scatterplot. At this stage you can edit, save, and print the scatterplot.

Revised Sept. 2007 Dr. Robert Gebotys

Page 50: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 50

3.3 Specifying the Regression Procedure for a Polynomial of Degree 2

Follow the instructions in Section 2.5 of this guide for Specifying the Regression

Procedure, with the exception that instead of only specifying ‘age’ as the independent variable, you should also define ‘agesq’ as the other independent variable in the model. This is done by clicking ‘agesq’ in the variable source list and then clicking the arrow button to the left of the ‘Independent[s]:’ text box. The dialog box should now resemble the one below.

After completing the procedures as specified in section 2.5, click the OK command pushbutton in the Linear Regression dialog box. This will instruct SPSS to produce a set of output similar to those reproduced in chapter 8 the course notes.

Revised Sept. 2007 Dr. Robert Gebotys

Page 51: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 51

There is another way of specifying and running the regression procedure for

fitting the quadratic model. If you have already saved the syntax commands in a file (e.g., crime.sps), as outlined in section 2.6 of this guide, you can specify and run the regression procedure by following the steps described below: 1. Insert the diskette containing the relevant file (e.g., crime.sps) into drive A. 2. Click File on the main menu bar. 3. Click Open in the File menu to activate and open File dialog box. 4. Check if the current position of the drive (i.e., the “Look in” text box) is drive A.

If not, change it to drive A by clicking on the arrow to the right of the text box and selecting “3.5 Floppy [A:]”.

5. Check if the File type text box contains “SPSS syntax files (*.sps)”. If not, change it by clicking on the arrow to the right of the text box and selecting that option using a single click.

6. The relevant file (e.g., crime.sps) should now be listed in the large text box in the centre of the Open File dialog box. Select the file with a single click and then proceed to that file by clicking the Open command pushbutton. This will open a window titled “crime – SPSS Syntax Editor”.

7. Go to the end of the line “/METHOD=ENTER age” and click once to move your cursor/pointer to that location. Add a space after “age” and then type agesq. Your command syntax should now look like the following:

REGRESSION /MISSING LISTWISE /STATISTICS COEFF OUTS CI R ANOVA /CRITERIA=PIN(.05) POUT(.10) /NOORIGIN /DEPENDENT crime /METHOD=ENTER age agesq /SCATTERPLOT=(*ZRESID ,*ZPRED ) /RESIDUALS DURBIN HIST(ZRESID) NORM(ZRESID) /CASEWISE PLOT(ZRESID) ALL /SAVE PRED ZPRED ADJPRED SEPRED MAHAL COOK LEVER RESID ZRESID SRESID DRESID SDRESID . If you want to save or print this syntax window, you may do so now. 8. Click Run on the Syntax Editor menu bar, and then click All on the Run menu.

This will instruct the computer to perform the required regression procedure.

Revised Sept. 2007 Dr. Robert Gebotys

Page 52: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 52

Part Four: Using SPSS for Windows to Implement the One-Way Analysis of Variance and Two-Way Analysis of

Variance This section will provide a quick guide on how to use SPSS for Windows to implement the following: A. One-way Analysis of Variance on the set of data concerning crime conditions and sentencing mentioned in chapter 14 of the course notes. B. Two-way Analysis of Variance on the set of data concerning crime conditions, age of respondents, and sentencing described in chapter 14 of the course notes. 4.1 Using the Syntax Editor to Specify the One-Way ANOVA Procedure

While SPSS for Windows offers ANOVA procedures under the “Compare Means” and “General Linear Model” options in the analyze menu, these procedures do not produce all the components we need for our analyses. Fortunately, SPSS for Windows allows us to use command syntax in the Syntax Editor to access a wider range of procedures and options than are available through the ‘point and click’ method.

In order to undertake a One-Way ANOVA of the crime and sentence data the

following steps are necessary.

1. Define the two variables, ‘crime’ and ‘sentence’, and enter the data into the Data Editor window.

2. Click File on the menu bar, then New, followed by Syntax. This series of clicks will open a SPSS Syntax Editor window.

3. Type the following command syntax into the Syntax Editor. Be sure to type the syntax exactly as you see it below (i.e., use appropriate case, spaces between words, etc.)

MANOVA sentence BY crime (1 3) /CONTRAST (crime)=SPECIAL (1 1 1 2 -1 -1 0 1 -1) /PARTITION (crime) = (1, 1) /DESIGN=crime (1) crime (2) /PRINT HOMEGENEITY (BARTLETT COCHRAN) /NOPRINT PARAM(ESTIM) /PLOT CELLPLOTS /RESIDUALS CASEWISE PLOTS /OMEANS TABLES ( crime ) /PMEANS TABLES ( crime ) /METHOD=UNIQUE /ERROR WITHIN+RESIDUAL.

Revised Sept. 2007 Dr. Robert Gebotys

Page 53: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 53

You may want to save and/or print the syntax window at this stage. 4. To instruct SPSS for Windows to conduct the analysis, click Run on the menu

bar, followed by All on the Run menu. The output obtained should resemble the output shown in chapter 14 of the course notes.

4.2 Using the SPSS Syntax Editor to Specify the Two-Way ANOVA Procedure

In order to undertake a Two-Way ANOVA of the ‘crime’, ‘age’, and ‘sentence’ data the following steps are necessary. 1. Define the three variables--‘crime’, ‘age’, and ‘sentence’-- and enter the data into the

Data Editor window. 2. Click File on the menu bar, then New, followed by Syntax. This series of clicks will

open a SPSS Syntax Editor window. 3. Type the following command syntax into the Syntax Editor. Be sure to type the

syntax exactly as you see it below (i.e., use appropriate case, spaces between words, etc.)

MANOVA sentence BY crime (1 3) age (1 4) /CONTRAST (crime)=SPECIAL (1 1 1 1 1 -2 1 -1 0) /CONTRAST (age)=SPECIAL (1 1 1 1 1 1 1 -3 1 1 -2 0

1 –1 0 0) /PARTITION (crime) = (1, 1) /PARTITION (age) = (1, 1, 1) /DESIGN=crime (1), crime (2), age (1), age (2), age (3), crime (1) by age (1), crime (1) by age (2), crime (1) by age (3), crime (2) by age (1), crime (2) by age (2), crime (2) by age (3) /PRINT HOMEGENEITY (BARTLETT COCHRAN) /NOPRINT PARAM(ESTIM) /PLOT CELLPLOTS /RESIDUALS CASEWISE PLOTS /OMEANS TABLES ( crime age ) /PMEANS TABLES ( crime age ) /METHOD=UNIQUE /ERROR WITHIN+RESIDUAL. You may want to save and/or print the syntax window at this stage. 4. To instruct SPSS for Windows to conduct the analysis, click Run on the menu

bar, followed by All on the Run menu.

Revised Sept. 2007 Dr. Robert Gebotys

Page 54: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 54

Part Five: Using SPSS for Windows to Implement Reliability Analyses

The following section will outline the steps necessary in undertaking three different forms of ‘single test administration’ reliability analyses: (1) Cronbach's alpha, (2) Split-half, and (3) Even-odd. For further discussion of these reliability measures, students are encouraged to consult Robert Gebotys’ “Handout on Reliability.” 5.1 Conducting a Reliability Analysis using the Cronbach's Alpha (α) Measure For this analysis we will use the data regarding adolescent attitudes toward physical aggression, as outlined on page 6 of Gebotys’ “Handout on Reliability.” In order to conduct this analysis, the following steps are required. 1. Enter the aforementioned data set into an SPSS Data Editor Window (see Section

2.1 for instructions, if necessary). 2. Next, click Analyze on the main menu bar, followed by Scale, and then

Reliability Analysis… This will open a Reliability Analysis dialogue box similar to the one shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 55: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 55

3. You should note that all of the variables (all Items) are listed in the text box at the left-hand side of the dialog box. Take your cursor and click on “item1.” Keeping your finger depressed on the left button of the mouse, scroll your mouse downward until all variables (i.e., item1 through item6) are highlighted. Once they are highlighted, click the right arrow button (<) in the centre of the dialog box to move the selected variables into the ‘Items:’ text box.

4. Next, check to see that text in the ‘Model:’ text box reads “Alpha.” If it does not, click on the downward arrow (?) to the right of the text box and select Alpha from the list that appears.

5. Next, click on the Statistics… pushbutton, which will open a ‘Reliability Analysis: Statistics’ sub-dialog box similar to the one below.

6. Next, select (i.e., click on) all options under ‘Descriptives for’ (i.e., item, scale,

scale if item deleted), ‘Summaries’ (i.e., means, variances, covariances, correlations), and ‘Inter-item’ (i.e., correlations, covariances). These are the

Revised Sept. 2007 Dr. Robert Gebotys

Page 56: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 56

primary statistics that you will need to interpret your reliability analyses. If, however, you would like further statistics, such as the ‘F test’ and ‘Hotelling’s T-square,’ you can make these selections from options in this sub-dialog box.

7. Once you have made your selections, click the Continue command pushbutton at the top right-hand corner of the sub-dialog box. This will return you to the ‘Reliability Analysis: Statistics’ sub-dialog box.

8. You have now completed all the necessary steps in specifying the reliability procedure. If you would like to examine the SPSS syntax for this procedure, please read the note below. If you would like to run this procedure now, without examining the syntax, click the OK command pushbutton at the top right-hand corner of the dialog box.

Note: If you would like to examine the SPSS syntax for this procedure, click on the Paste command pushbutton to open an SPSS Syntax Window. The syntax window should then resemble the one below. In order to run this syntax and complete the reliability analysis, click Run on the menu bar, followed by All.

Revised Sept. 2007 Dr. Robert Gebotys

Page 57: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 57

Once you have run the Cronbach's Alpha reliability procedure, the results should appear in an SPSS Viewer window similar to the one shown below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 58: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 58

At this stage it is recommended that you save and print the contents of the SPSS Viewer window. The steps that you take to save and print this reliability analysis are identical to the steps taken to save and print the Scatterplot, as outlined in section 2.4 of this guide. Your output should resemble the output shown in the Handout on Reliability. 5.2 Conducting the Split-Half Reliability Analysis

Please note that the steps necessary for conducting the Split-Half reliability analysis are almost identical to the procedures outlined above for the Cronbach’s Alpha analysis. The only difference when using SPSS for Windows is that you must specify the “Split-Half” model instead of the “Alpha” model in the Reliability Analysis dialog box. Therefore, for the Split-Half model, step #4 should read as follows:

#4. Next, check to see that text in the ‘Model:’ text box reads “Split-half.” If it does not, click on the downward arrow to the right of the text box and select Split-half from the list that appears.

The SPSS Syntax window for the Split-half analysis should resemble the example below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 59: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 59

Again, it is recommended that you save and print the contents of the SPSS Viewer window. Your output should resemble the output shown in the Handout on Reliability.

5.2 Conducting the Even-Odd Reliability Analysis Unlike the Cronbach’s Alpha and Split-Half models, the Even-Odd method of assessing reliability cannot be accessed using the “point and click” approach in SPSS. In order to utilize the Even-Odd option, one needs to modify the syntax file for the Split-Half model. More specifically, the order of the items examined needs to be changed so that the odd items form the first part of the scale and the even items form the remaining part. Therefore, your first step should be to follow the instructions noted above for undertaking the Split-Half model, but then be sure to click the Paste command pushbutton in the Reliability Analysis dialog box in order to open the SPSS Syntax window. Recall that the syntax for the Split-Half model contains the following information: RELIABILITY /VARIABLES=item1 item2 item3 item4 item5 item6 /FORMAT=NOLABELS /SCALE(SPLIT)=ALL/MODEL=SPLIT /STATISTICS=DESCRIPTIVE SCALE HOTELLING CORR COV ANOVA /SUMMARY=TOTAL MEANS VARIANCE COV CORR . For the Even-Odd model, you will need to make the following change to line 4 of the syntax file (note: the part to be changed is in bold):

Before: /SCALE(SPLIT)=ALL/MODEL=SPLIT After: /SCALE(SPLIT)= item1 item3 item5 item2 item4 item6/MODEL=SPLIT

The entire syntax file should now read: RELIABILITY /VARIABLES=item1 item2 item3 item4 item5 item6 /FORMAT=NOLABELS /SCALE(SPLIT)= item1 item3 item5 item2 item4 item6/MODEL=SPLIT /STATISTICS=DESCRIPTIVE SCALE HOTELLING CORR COV ANOVA /SUMMARY=TOTAL MEANS VARIANCE COV CORR . Once you have made the change noted above, click Run on the menu bar followed by All. The analysis output should then appear in an SPSS Viewer window. You should then proceed to save and print the analysis. Your output should resemble the output shown in the Handout on Reliability.

Revised Sept. 2007 Dr. Robert Gebotys

Page 60: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 60

Part Six: Using SPSS for Windows to Conduct Factor Analyses (i.e., tests of factorial validity)

This section will outline the steps necessary for conducting the factor analysis procedure as a test of validity, and should be read in conjunction with Robert Gebotys’ “Handout on Validity.” 6.1 Specifying the Factor Analysis Procedure For this analysis it is recommended that one use the data set on adolescent attitudes towards aggression (outlined in Gebotys’ “Handout on Validity” p. 5) as used in the previous section on reliability analyses. The recommended steps are outlined below. 1. Begin by entering the data into a Data Editor window or -- if you have saved the

data from the earlier reliability analyses -- retrieve the existing data file. 2. Next, click on Analyze on the main menu bar, then Data Reduction, followed by

Factor… This will open a ‘Factor Analysis’ dialog box similar to the one below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 61: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 61

3. Next, select all the variables to be analyzed by clicking on the first item on the list and scrolling your mouse downward until all items are highlighted. Once they are highlighted, click the right facing arrow in the centre of the screen to move the variables to the “Variables…” text box.

4. Now, click on the Descriptives… pushbutton which will open a ‘Factor Analysis: Descriptives’ sub-dialog box similar to the one shown below.

5. Once in the ‘Factor Analysis: Descriptives’ sub-dialog box, under the heading

‘Correlation Matrix’ select ‘coefficients’ with a single click on the appropriate check box. Then click the Continue command pushbutton, which will return you to the Factor Analysis dialog box.

Revised Sept. 2007 Dr. Robert Gebotys

Page 62: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 62

6. Next, click on the Extraction… pushbutton at the bottom of the dialog box, which will open a ‘Factor Analysis: Extraction’ sub-dialog box like that shown below.

7. If not already selected, under the heading ‘Analyze’ select “correlation matrix.”

Under the heading ‘Display’ select “unrotated factor matrix” and “scree-plot.” Under the heading ‘Extract’ select “Eigenvalues over 1.” (Note: the majority of these options will be the '‘default” option.) Once these options are selected, click the Continue command pushbutton to return you to the Factor Analysis dialog box.

Revised Sept. 2007 Dr. Robert Gebotys

Page 63: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 63

8. Next, click on the Rotation pushbutton at the bottom of the dialog box, which

will open a ‘Factor Analysis: Rotation’ sub-dialog box like the one shown below.

9. Next, under ‘Method’ select “Varimax” by clicking on the radio button adjacent

to that option. Under ‘Display’ select “Rotated solution” and “Loading plot(s).” Then, click the Continue command pushbutton to return you to the Factor Analysis dialog box.

10. Click on the ‘Scores’ pushbutton at the bottom of the dialog box which, will open a ‘Factor Analysis: Scores’ sub-dialog box like the one below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 64: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 64

11. Next, select “Display factor score coefficient matrix” by clicking on the check

box to the left of that option. Then, click the Continue command pushbutton to return you to the Factor Analysis dialog box.

12. You have completed all the selections necessary for undertaking this procedure. If you would like to go directly to running the procedure click the OK command pushbutton to proceed. If you would like to view the SPSS syntax for this procedure, you may now click the Paste command pushbutton, which will open an SPSS Syntax window resembling the one below.

Revised Sept. 2007 Dr. Robert Gebotys

Page 65: Guide to Using SPSS for Windows (11

Guide to SPSS 15.0 Page 65

Again, in order to run the Factor Analysis procedure from the SPSS Syntax window, click Run on the main menu bar followed by All. It is recommended that you save and print the output at this time. Your output should resemble the output shown in the Handout on Validity.

Revised Sept. 2007 Dr. Robert Gebotys