skip navigation
Geography Department Banner.  Click to link to Geography Department Website
-
California State University, Northridge Logo.  Click to link to the C.S.U.N. home page.

Geography 300

Graphics and SPSS Lab

Image: Compass and Map Icon

Introduction

Many geographers collect data and have a need to display the data. Most of the time we do this with maps, but on occasion, some data is better displayed in a chart or graph. One of the common, efficient ways to communicate your findings or display your data is through charts, graphs and tables. Many students don't know how to construct common graphics and this exercise is intended to help you learn how to use SPSS to make a few of the more common graphics used by geographers.

SPSS (Statistical Package for the Social Sciences) is probably the most widely used statistical software and it has improved by leaps and bounds in recent years. A well-rounded geographer should have at least a passing familiarity with SPSS. CSUN has a university wide site license for SPSS, which should make it available in many university computing labs, including ones at Oviatt Library . SPSS did offer a trial version of the software. They may have rescinded the offer, but you can search for it if you'd like at: http://www.spss.com/

I strongly encourage you to come to the Department of Geography and use our GIS labs for this exercise. You can use room 103 or 107, but you enter through room 105. One of the unexpected bonuses of doing this exercise is that several students who have not yet visited our lab, can familiarize themselves with this facility. Hopefully, you can network with some of your fellow geography students. Several students seem to basically hang out there.

Objectives:

  1. Students will demonstrate basic facility with the most common functions in SPSS.
  2. Students will demonstrate basic facility with the graphing function in SPSS.
  3. Students will display a data set using several common graphic devices (histogram, XY scatterplot and bar graph).

Readings:

  1. Chapter 19 in your text (Richard Field)
  2. Chapter 24 in your text (John H McKendrick) - skim ...or read carefully if you think you'll really need this.

Assignment: 

After you've read Chapter 19 regarding the handling and display of geographic data, you should be ready to try to make some charts and graphs of your own, as well as perform a few of the more basic statistic computations.  Don't panic.  Follow the steps below and you'll be fine.

Steps

1. First you need data. I have transcribed the data from the appendix of Chapter 19 (p 340-1) the data Richard Field appears to have used to make several of the graphics in that chapter. Download this file here. Remember to download it to your desktop, or someplace where you know you can find it.

DATASET IN EXCEL-300_graphing_lab.xls

2. Next you'll need to open SPSS. It's in the start menu under programs on later versions of Windows. Yours may be launched elsewhere, depending on your operating system.

3. The first dialog box you'll see (figure 1 below) gives you several options for running SPSS. The option you need to choose is "Open an existing data source", because you will be using the dataset you downloaded in Step 1 above.

4.  In this dialog box (figure 2), find and select (see figures in 2b) the file that you have downloaded and click OK.

Table of Figures
Figure 1 Figure 2 Figure 2b Figure 3 Figure 4 Figure 4b
figure 1
figure 2
figure 2b
figure 3
figure 4
figure 4b

click to enlarge

click to enlarge
click to enlarge
click to enlarge
click to enlarge
click to enlarge

5.  Another dialog box will appear (figure 3).  This box is asking you if you want to open the data range (a group of rows and columns of data) in the named worksheet (in figure 3, this worksheet is called Master) in Excel.

6. Once you click OK, the Excel worksheet opens up in the SPSS Data Editor Window. The data is arranged in a spreadsheet format that contains variables in columns and cases in rows. There are two sheets in the window. The Data View (figure 5)  is the sheet that is visible when you first open the Data Editor and contains the data. You can access the second sheet (see figure 4b) by clicking on the tab labeled Variable View and while the second sheet is similar in appearance to the first, it does not actually contain data. Instead, this second sheet contains information about the dataset that is stored with the dataset. This is where you would set the properties for the variables (UT Austin, SPSS for Windows: Getting Started).

8.  In the variable view you can see that some of your data is string or "nominal" and some data is numeric and/or scale data. This may be useful to check.  You may recall from a previous Excel based lab that ZIP codes (for example), though really string-nominal (text) data, often appear as, or are treated by the software as numeric data.  THIS IS IMPORTANT BECAUSE GIS SOFTWARE OFTEN WILL NOT READ ZIP CODES WHICH IT RECOGNIZES AS NUMERIC DATA.

9. You may want to widen the column headings. You do it the same way as it is done in Excel. Just place your cursor in the space between the column heading cells and click and drag to widen the cell.

Descriptive Statistics

10.  Back in the  Data View window, click on Analyze in the top menu bar.  A drop down menu of possible analytical functions will appear.  Many of these analytical functions are useful to geographic study, but only the most basic are necessary for this exercise.  Nevertheless try to make a mental note of some of the functions available.

11. A good starting place is descriptive statistics. Recall from a previous exercise that descriptive statistics include things like average, count and standard deviation. From the drop down menu under Analyze, select Descriptive Statistics and from the drop down submenu, select Descriptives (see figure 5).

12. The descriptives dialog box will appear with all the variables from the table in the left window. Highlight them all (see figure 6 top) and click on the right pointing triangle to move them into the right window (see figure 6 bottom) The variables that you place on the right side window will be analyzed by SPSS.

You can also click on the variable names while holding down shift and control, which will allow you to select multiple variables. 

13. Before you click OK, click the options button. This will open another dialog box. This options dialog box allows you to select some other useful statistics that you may need later. Check them all and click OK. This will return you to the Descriptives dialog box. Click OK again....and watch the magic! SPSS will calculate for you all of the statistics that you requested and display them in a separate "Output Window".  See figure 7 below.

14. You may recognize several of these stats already. Some you may not recognize or understand. For a description of each of these measures and some explanation the best thing to do is to look it up in the help menu and under topics. Click the link below to see a list of outside resources regarding some of these terms.

Statistics Links

Table of Figures
Figure 5 Figure 6 Figure 7
figure 5
figure 6
figure 7
click to enlarge
click to enlarge
click to enlarge

15. Answer question 1.  Which of the variables has a distribution that is closest to normal?

16. Answer question 2.  Which of the variables has the distribution most skewed to the right (or positively skewed)?

17.  Answer question 3.  What is the graphic device in figure 7 (19.7) called in your textbook?  (summary table) check pages 318-319 in your text.

Crosstabs Table

 

18. On to the next task. In the menu bar at the top of your display, click on Window and select from the two options Window 1 "Untitled- SPSS data editor". This will return you to your window displaying the raw data.

19. Again click on Analyze and select from the drop down menu Descriptive Statistics.

20. Select Crosstabs from the drop down submenu (see figure 8a). The crosstabs dialog box (figure 8b) will appear. Select Plant Growth from the variables listed on the left, click the right triangle to move it into the Rows box. Then select Light from the variables listed, click the right triangle to move it into the Columns box then click OK to generate the cross-tabs table.  A new output table (figure 8c) will appear below the last set of statistics you produced in the SPSS "viewer" output window.

Table of Figures
Figure 8a Figure 8b Figure 8c
Figure 8a
figure 8b
Figure 8c
click to enlarge
click to enlarge
click to enlarge

21.  Examine the cross-tabs table.  It's not very interesting in this instance, but cross-tabulated data can be very useful.  If you have several subsets of data in a dataset and you want to bring out or highlight the differences between/among the data subsets, crosstabs is the way to do it.   Quite a few students have used this very function in SPSS when they were analyzing the results of a survey they conducted.  They may have wanted to compare the answers of men vs. women, or locals vs. tourists, etc. 

22.  Answer Question 4.  In your cross tabulated table, what is the maximum amount of growth for a record in the "low" light category?

Graphs in SPSS: HISTOGRAM

Next you will make several standard graphics that you may eventually find useful for displaying data and statistical findings.  Histograms are a very common tool for geographers.

23.  Click on Graphs in the top menu bar of the Data View window. From the drop down menu select Histogram (figure 9a). 

24.  Select (highlight) from the list of variables "Rainfall" and click the right arrow triangle to place Rainfall in the Variable window. (figure 9b)

25.  Check the box left of  "Display Normal Curve"  (see figure 9b below).  Click OK.

26.  A graph will appear in the output viewer.  Examine the histogram and answer the questions below.

27.  See figure 9c and answer the questions below.

Table of Figures
Figure 9a Figure 9b Figure 9c
Figure 9a
figure 9b
figure 9c
click to enlarge
click to enlarge
click to enlarge

28.  Answer question 5: What is the average rainfall?

28b.  Answer question 6:  What is the standard deviation for rainfall?

28c.   Answer question 7:  Does the distribution of rainfall amounts reasonably mimic the normal distribution...would you characterize this distribution as "normal" or "bimodal".

28d.   Answer question 8:  How does this relate to the kurtosis statistic that you generated using the "descriptives" function earlier?

29.  Repeat the procedure, but this time make a histogram of plant growth. 

30.  Check out your histogram.  It should roughly resemble the histogram depicted in Figure 19.4 on page 322 of your text.

31.  You may want to experiment with the chart editing function in SPSS.  By double-clicking on the histogram itself in your output window, a graphics "chart" editor will open in a separate window and you can change several elements in the graph.  For example, by clicking on the X in the chart editor and changing some of the variables in the histogram options in the properties dialog window, you can nearly mimic the look of Figure 19.4 from your text. 

SCATTERPLOT GRAPHS

32.  Next you will create a scatterplot diagram of plant growth and the variables in your data that may be affecting it.  Before you do that, you should calculate the correlation among the variables. 

33.  Click on Analyze in the top menu bar (figure 10a).  Select Correlate from the drop down menu and then select Bivariate from the drop down submenu.

34.  A dialog box will open.  Select (highlight) all the variables in your list, except "ID", and put them in the variables box by clicking on the right arrow triangle.  Your dialog box should look like that in figure 10b below.  Click OK.

35.  SPSS will produce a table of correlation coefficients in the output viewer.  Look at the column (or the row) of data for Plant Growth.  You should notice that there is not much correlation between any of the variables and the amount of growth plants undergo.  Only one variable has a correlation that is significant. 

Table of Figures
Figure 10a Figure 10b Figure 10c
figure 10a
figure 10b
figure 10c
click to enlarge
click to enlarge
click to enlarge

36.   Answer question 9:  Which of the variables co-varies most (or has the highest correlation coefficient) with plant growth?

37.   Answer question 10:  What is the Pearson's correlation coefficient between plant growth and rainfall? 

38.   Answer question 11:  What does this suggest about plant growth and rain?

39.  Next make a scatterplot diagram that displays the correlation between temperature and plant growth.

40.  Click on Graphs from the top menu bar.  Select Scatter/Dot from the drop down menu (see figure 11a).  The default type of scatterplot is Simple.  Make sure it's chosen and click Define (see figure 11b).

41.  A dialog box prompting you to select variables to plot on X and Y axes will appear.  You should select Plant Growth for the Y (up and down) axis and move it to the Y -Axis window.  You should select temperature for the X (left to right) axis and move it to the X axis window.  Also, since fertilizer probably is important, select the fertilizer variable and place it in the "Set Markers by.." dialog window (see figure 11c).  Click OK.

42.  Examine your X-Y scatterplot.  It should appear in the SPSS viewer and look like the right most part of figure 11c.  Answer the questions below.

Table of Figures
Figure 11a Figure 11b Figure 11c
figure 11a
figure 11b
figure 11c
click to enlarge
click to enlarge
click to enlarge

43.   Answer question 12:  How would you characterize the effect of fertilizer on the growth of plants? 

44.   Answer question 13:  How would you characterize the effect of temperature on the growth of plants? 

45.  The last step to take in the scatterplot section is the separation of data by fertilizer vs. non fertilizer.  To create separate graphs, go to back to the data (spreadsheet)  window.

46.  Click on Data on the top menu bar.  Select split file from the drop down menu (see figure 12a).  A dialog box (figure 12b ) will appear and you will click on the radial button adjacent to "organize output by groups", and select Fertilizer as the group by which your output (graphs, etc) will be organized by.  See Figure 12b.

47.  Go back and repeat the steps you undertook to make your first scatterplot graph.  If you've been working continually, the variables that you used to set up the first scatterplot diagram should be still chosen (or selected) in the scatterplot diagramming dialog box (it should look like  figure 11c...left).

48.  Click OK and examine the graphics in the output viewer.  You should see two scatterplot graphs.  One featuring only those with "no" fertilizer and the other with "yes" fertilizer. 

49.  You can replicate this graph, using the same logic and the same steps in the "interactive graph" feature, available from the 'graphs' menu.  Just select interactive from the drop down menu (see figure 13a) and scatterplot from the submenu.   This function graphing window is a little different because it allows you to click and drag variables.  See figures in 13b below. 

50.  Click on the "Fit" tab at the top of the Create Scatterplot dialog window.  Figure 14 below show that you should select Regression from the list of methods available.  Click OK.  Check out the two graphs made in the output window.  The "Yes" fertilizer graph should resemble Figure 19.5 from page 326 of your text.  The scale on the Y axis is different, and you can change that with a little experimentation.  

Table of Figures
Figure 12a Figure 12b Figure 13a Figure 13b Figure 13c Figure 14
figure 12a
figure 12b
figure 13a
figure 13b
figure 13c
figure 14
click to enlarge
click to enlarge
click to enlarge
click to enlarge
click to enlarge
click to enlarge

21.  You have several options for credit.  The option that is easiest for you is to save your work in .spo format, which is a SPSS output file and email that to me. For five additional points, you will copy and paste your graphics into a Microsoft Word (or Wordperfect) file and send that to me via email, or via livetext for an additional five bonus points. You can also copy and paste your graphics straight into live text into a project file that would display your SPSS and graphics skills to potential employers.

22.  You can get even more bonus credit (5% of this assignment) if you can write a detailed, step by step instructions on how to do one other useful (as mentioned in the text perhaps) function in SPSS. Click on the link below to see an example.

CLICK HERE TO SEE AN EXAMPLE (.pdf).......-or ..... example in .htm

Fill in your information and submit.  You may want to print and/or save a copy of the results page for your records .

When you click the button below, you will be directed to a web page displaying your answers. The instructor will get a copy of this email as well, but you may want to keep a copy for your records. If you are curious about the correct answers, please bring your questions to class or request that Dr. Graves email answer to you.

 

 

C.S.U.N. Seal About Dr. Graves | Site Map | Contact Dr. Graves | ©2003 Steven M. Graves - Geography Department, California State University - Northridge