2
SPSS ACTIVITY
Learning the Basics Welcome to the world of Statistical Package for the Social Sciences (SPSS) programming. To augment your learning of statistical concepts in this text, we will provide SPSS computer activities that will allow you to apply your new knowledge. The following introduction is intended to familiarize you with the use of this software package, which combines spreadsheets, statistics, and graphic functions. You will need this application to analyze your data from various exercises and to complete activities. SPSS can be a little tricky in the beginning, but as you come to understand it, your assignments will go smoothly. Taking time to learn it now will save you hours in the long run.
Entering Data To open the program, click on the SPSS icon on the desktop. This will open a new spreadsheet in SPSS. Exactly how SPSS will open on your computer may vary. Check with your instructor. Move your cursor to the bottom of the spreadsheet and click on Variable View. Type “Gender” in the first box under the Name column to identify the first variable to be entered. Gender is measured nominally, so we will be using M and F (letters, rather than numbers) to identify gender. Thus, it is necessary to change the type of variable being entered from Numeric to String. To do this, click on the first box in the Type column. The word “Numeric” will appear. Click on the little box next to the word “Numeric” and a Variable Type screen will appear. Select String and click OK. Next, move to the column called Label and click on the first box. Here you can label your variable. Type in “Gender of subject.” Now go to the column called Measure and make sure it reads “Nominal.” If it doesn’t, click on the first box, and a pull-down menu will appear. Open the pull-down menu and click Nominal. Next, move the cursor to the bottom of the spreadsheet and click on Data View. You will now begin to enter the data for your first variable. Type M in the first box. Move to the next row to enter your second data point, and type F. Continue in this manner, entering the gender of the remaining eight subjects as M, F, F, F, M, M, M, F. Go back to the Variable View screen. Click on the box under the Gender box and name your next variable “Bodywt.” (Note: In SPSS, variable names cannot contain spaces or special characters and must begin with a letter.) In the Type column, the word “Numeric” should appear, which is correct for this variable. Go to the Label column to enter the full identification of this variable as “Body Weight, lb.” Check to be sure Scale is listed in the Measure column. (This indicates that body weight is measured at either an interval or ratio level.) Now, go back to the Data View screen to enter the data for the body weight variable. Go to the data entry boxes and insert, in this order, the following body weights: 170, 120, 140, 129, 100, 107, 190, 149, 116, 90. Click on Variable View to move to the next input column, and title it “Height.” Be sure it is numeric, and label it “Height, in.” Confirm that the measure is Scale. Go to Data View and enter the following heights: 68, 60, 64, 62, 58, 59, 70, 65, 65, 56. Notice that each row represents a different subject and each column represents a different variable.
Calculating New Variables Suppose you wish to express your body weight data in kilograms rather than pounds. To do this, you have to divide each data point in the second column by 2.2. Let’s have the computer do this for us. Go up to the main toolbar, click on Transform, and select Compute Variable. This will open a Compute Variable screen. In the Target Variable box, type “weightkg,” and click on the blank box under the phrase “Numeric Expression.” To enter the formula, double-click on Body Weight, lb. This will insert bodywt in the formula box. Move the cursor to the end of bodywt and type “/2.2.” You can also use your mouse and cursor to select these values from the calculator that appears on the screen. Now, click OK and confirm that your new variable has been inserted in the weightkg column. If you have done this correctly, you should see 77.27 in the first box, 54.55 in the second box, and so forth.
Saving Your Spreadsheet To save your spreadsheet now or at any time, select Save As… from the File menu on the top menu bar. Give your spreadsheet a distinctive name. As in any other application, you must be sure to save your spreadsheet to some location. You can save it to the desktop temporarily (if placed on the desktop, it might be erased when you log out), or you can save it to your flash drive or a cloud service, for example. When you are certain that you are saving to wherever it is you want, click Save.
Creating Bar Graphs Suppose you are interested in examining the relationship between body weight and gender. That is, do males and females differ in their body weights? Similarly, we might be interested in the difference in height between males and females. To analyze weight and height as a function of gender, click on Graphs on the menu bar, select Legacy Dialog, and then select Bar. Now, select Clustered and Summaries of separate variables, and click on Define. A window entitled Define Clustered Bar will appear. Because we are interested in weight and height, we want to assign weight and height as variables to the Bars Represent box on the right side of the window. You assign these variables by highlighting them in the left side of the box at the left and using the arrow to move them into the box on the right. Move Body Weight, lb into the box. When you transfer height and weight to the box, they will appear as MEAN(Bodywt) and MEAN(Height). Next, highlight Gender and move it into the Category Axis window by using the arrow. There are many other options to choose from, but we will do only this much for now. Click OK. This will result in an untitled view of a bar chart displaying the mean heights and weights of the male and female subjects.
To change the look of the bar graph, you can alter its shape, configuration, and other features. For example, to change the Y-axis, double-click in the middle of the graph. A new window labeled Chart Editor will appear. Double-click on the numbers of the Y-axis and make any appropriate changes to the Y-axis in the box that pops up. For example, change the number of major increments by selecting Scale on the top menu of the Properties box and changing 50 in the Major Increment box to 25. Experiment with other possible modifications.
Modifying and Transferring Figures to a Microsoft Word Document After you have created a graph, you can paste it into a word processing document, such as one you might prepare for a report. Go back and create the original bar graph, if you have not saved it to this point. Assume that you wish to paste the bar chart into a report but also wish to remove the text at the top of the figure and add a title more to your liking before you paste it into your document. First, in SPSS, create a box around your graph by clicking anywhere on the graph. In the Edit menu on the SPSS toolbar, select Copy. Look at the Copy Special option. Copy Special allows you to copy and then paste in a variety of formats (e.g., jpg, bmp, eps, tif, png). Choose the format that best meets your needs. Now open a document file. Place the cursor on the document page where you want the graph to appear. Now, select Paste (or Paste Special). The graph will appear on your page. Try different copy and paste formats to see what occurs, and experiment with ways of editing your figures. To add an appropriate title, simply type it above the graph. You will need to move the graph down on the page, if you put it at the top originally.
V.2.5 Starting SPSS
Review You should be able to perform the following tasks comfortably now:
enter data (either numerical or word-based data) n locate descriptive statistics for each set of data n create new data using the Compute Variable box n create a histogram (bar graph) n change the graph in various ways n transfer graphs into a Word document n
This concludes the tutorial for using the SPSS statistics and graphics package. You may save your work to your own flash drive as you would in any application, by selecting Save in the File menu. You might wish to try other analyses or graphical functions of SPSS. SPSS can compute literally dozens of parametric and nonparametric statistics. Browse when you have the time and the inclination. You can become more proficient with SPSS as you practice, practice, practice.