Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Working with Time Series Data

Reading a Simple Time Series

Time series data can be recorded in many different ways. The section "Reading Time Series Data" later in this chapter discusses some of the possibilities. The example below shows a simple case.

The following SAS statements read monthly values of the U.S. Consumer Price Index for June 1990 through July 1991. The data set USCPI is shown in Figure 2.1.

   data uscpi;
      input year month cpi;
   datalines;
   1990  6 129.9
   1990  7 130.4
   1990  8 131.6
   1990  9 132.7
   1990 10 133.5
   1990 11 133.8
   1990 12 133.8
   1991  1 134.6
   1991  2 134.8
   1991  3 135.0
   1991  4 135.2
   1991  5 135.6
   1991  6 136.0
   1991  7 136.2
   ;
   
   proc print data=uscpi;
   run;

 
Obs year month cpi
1 1990 6 129.9
2 1990 7 130.4
3 1990 8 131.6
4 1990 9 132.7
5 1990 10 133.5
6 1990 11 133.8
7 1990 12 133.8
8 1991 1 134.6
9 1991 2 134.8
10 1991 3 135.0
11 1991 4 135.2
12 1991 5 135.6
13 1991 6 136.0
14 1991 7 136.2
Figure 2.1: Time Series Data

When a time series is stored in the manner shown by this example, the terms series and variable can be used interchangeably. There is one observation per row, and one series/variable per column.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.