Previous Page | Next Page

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 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 3.1.

   data uscpi;
      input year month cpi;
   datalines;
   1990  6 129.9
   1990  7 130.4
   
   ... more lines ...   

   proc print data=uscpi;
   run;

Figure 3.1 Time Series Data
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

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.

Previous Page | Next Page | Top of Page