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.
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 researches to explore graphically any trends 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.
This example explores the level of corn production in the United States measured annually from 1876 to 2015. There are 140 observations in the dataset. The two variables we examine are:
The corn production variable is a continuous variable measured every year, making this an appropriate variable to plot as a time series.
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. Figure 1 shows what this looks like in SPSS.
(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 then “Scan Data” and SPSS will execute this task for you automatically.)
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 year. Next, drag and drop the cornproduction variable into the text box labeled “Y-Axis?” Note that SPSS will display the variable label for the corn production variable (e.g. “Corn Production, Bushels”) and not the actual variable names if such labels are available. Figure 2 shows what this looks like in SPSS.
Once done, click OK to produce the plot.
Executing the procedure above produces the time series plot shown in Figure 3.
Notice that Figure 3 only shows a line moving up and down from year to year. 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.
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.
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 shows a gradual increase in corn production from the start of the time series to about 1910, though there is some volatility from year to year. Beginning just before 1920 there is a gradual decline in production that continues to the end of World War II in 1945. Production then increases first steadily and then more dramatically from that point forward. However, there are some sharp declines in the 1980s and again in the 1990s, with that particular period showing more overall volatility than any other portion of the 140-year series.
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 level of corn production 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 non-linear curve to the data (see the SAGE Research Methods Datasets module on Time Series Fitted Lines).
Download this sample dataset and see if you can replicate the results. Then repeat the process using either the variable barleyproduction or the variable oatsproduction plotted over time. These two variables measure the production of barley and oats, respectively, in millions of bushels in the United States over the same 140-year time period.
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.