How-to Guide for IBM® SPSS® Statistics Software
Introduction

In this guide, you will learn how to produce a time series plot for a single variable in IBM® SPSS®Statistical Software (SPSS) using a practical example to illustrate the process. You are provided with links to the example dataset and you are encouraged to replicate this example. An additional practice example is suggested at the end of this guide. The example assumes you have already opened the data file in SPSS.

Contents
  • Time Series Plot
  • An Example in SPSS: Daily Air Quality Index (AQI), 2017
    • The Procedure in SPSS
    • Exploring the SPSS Output
  • Your Turn
1 Time Series Plot

A time series plot is a particular kind of two-way scatter plot, where time is plotted on the horizontal axis and values of the variable in question are plotted on the vertical axis. Such a plot allows researchers to explore graphically any trend or other over-time dynamics that might be present in a particular variable. Typically, the variable of interest is a continuous variable. Time is generally measured in equidistant units – days, months, years – though that is not required to produce a time series plot.

2 An Example in SPSS: Daily Air Quality Index (AQI), 2017

This example explores the daily air quality in the New York county in the United States in the year 2017. This example uses a subset of data from EPA’s Air Quality System Data Mart (https://aqs.epa.gov/aqsweb/documents/data_mart_welcome.html). The two variables we examine are:

  • AQI: air quality index.
  • Date: from 1 January 2017 to 2 October 2017.

There are 275 observations in the dataset. The air quality index is a continuous variable recorded daily, making this an appropriate variable to plot as a time series.

2.1 The Procedure in SPSS

You can produce a two-way scatter plot in SPSS using the Chart Builder menu. Begin by selecting from the menu:

Graphs → Chart Builder

This opens a Chart Builder dialog box. (Note: You may get a message asking you to define the level of measurement for variables in your dataset before you can proceed to building the chart. If you get this message, typically you can select OK, and SPSS will execute this task for you automatically.) Figure 1 shows what this looks like in SPSS.

Figure 1: Selecting Chart Builder From the Graphs Menu in SPSS.
Figure

In the process below, you might get a “Element Properties” pop-up window at some point; it is okay to just close the window.

In the lower half of the Chart Builder dialog box, select from the lower left menu “Line.” Two icons for line plots appear. The one on the left is for a simple line plot. Drag and drop that icon up into the open window in the upper half of this dialog box where the instructions say “Drag a Gallery chart here ….”

Next, drag and drop the variable you want plotted on the x-axis into the text box labeled “X-Axis?.” For this example, the variable is Date. Next, drag and drop the AQI variable into the text box labeled “Y-Axis?.” Figure 2 shows what this looks like in SPSS.

Figure 2: Building a Line Plot in the Chart Builder Dialog Box in SPSS.
Figure

Once done, click OK to produce the plot. Executing the procedure above produces the time series plot shown in Figure 3.

Figure 3: Time Series Plot of Daily Air Quality Index in New York County in 2017.
Figure

Notice that Figure 3 only shows a line moving up and down from day to day. If you want to add markers at each point, you need to click on the chart as produced in SPSS to select it, then follow the menus:

Edit → Edit Content → In Separate Window

This will open the chart in a Chart Editor window, as shown in Figure 4.

Figure 4: Opening a Chart in the Chart Editor Window in SPSS.
Figure

To add markers for each data point, you can either click on the “Elements” menu item and select “Add Markers” or you can click on the fourth icon from the left in the row of icons just above the chart itself. Either way, a Properties dialog box will open as shown in Figure 5. By default, SPSS will select empty circles as markers for the data points. This can be changed by selecting the “Marker” button at the top of the Properties dialog box and making new selections. Figure 5 shows what this looks like.

Figure 5: Selecting Marker in the Properties Dialog Box From the Chart Editor in SPSS.
Figure

Once you have configured the markers as desired, click the “Apply” button in the Properties dialog box and close the Chart Editor window. The graph you originally created will be updated automatically, and in this case, will look like Figure 6.

Figure 6: Time Series Plot of Daily Air Quality Index in New York County in 2017, With Point Markers.
Figure

2.2 Exploring the SPSS Output

Figure 6 shows a relatively stable level of air quality in 2017, though there is some volatility from day to day. The air quality seems to improve during the summer, and there are several days between May and September with air quality much better than average. The air quality tends to decrease as winter starts, probably because of the use of heat.

Two common statistical measures of correlation – the Pearson correlation coefficient and the Spearman rank-order correlation coefficient – can be computed to measure the association between the AQI and time (see the SAGE Research Methods Datasets modules on these methods). The Pearson correlation coefficient assumes a linear relationship between the two variables in question, while the Spearman rank-order correlation coefficient only assumes a monotonic relationship. Figure 6 suggests that neither is ideal since the pattern is neither linear nor monotonic. When plotting a single time series, researchers might also explore fitting a trend line or a nonlinear curve to the data (see the SAGE Research Methods Datasets module on Time Series Fitted Lines).

3 Your Turn

Download this sample dataset and see whether you can replicate the results. Then, repeat the process using either the variable PM2.5 or the variable Ozone plotted over time. These two variables measure the level of PM2.5 in micrograms per cubic meter and level of ozone in parts per million, respectively.

IBM® SPSS® Statistics software (SPSS) screenshots Republished Courtesy of International Business Machines Corporation, © International Business Machines Corporation. SPSS Inc. was acquired by IBM in October, 2009. IBM, the IBM logo, ibm.com, and SPSS are trademarks or registered trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at “IBM Copyright and trademark information” at http://www.ibm.com/legal/copytrade.shtml