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

Storing Time Series in a SAS Data Set

This section discusses aspects of storing time series in SAS data sets. The topics discussed are the standard form of a time series data set, storing several series with different time ranges in the same data set, omitted observations, cross-sectional dimensions and BY groups, and interleaved time series.

Any number of time series can be stored in a SAS data set. Normally, each time series is stored in a separate variable. For example, the following statements augment the USCPI data set read in the previous example with values for the producer price index.

   data usprice;
      input date monyy7. cpi ppi;
      format date monyy7.;
      label cpi = "Consumer Price Index"
            ppi = "Producer Price Index";
   datalines;
   jun1990 129.9 114.3
   jul1990 130.4 114.5
   aug1990 131.6 116.5
   sep1990 132.7 118.4
   oct1990 133.5 120.8
   nov1990 133.8 120.1
   dec1990 133.8 118.7
   jan1991 134.6 119.0
   feb1991 134.8 117.2
   mar1991 135.0 116.2
   apr1991 135.2 116.0
   may1991 135.6 116.5
   jun1991 136.0 116.3
   jul1991 136.2 116.0
   ;
   
   proc print data=usprice;
   run;

 
Obs date cpi ppi
1 JUN1990 129.9 114.3
2 JUL1990 130.4 114.5
3 AUG1990 131.6 116.5
4 SEP1990 132.7 118.4
5 OCT1990 133.5 120.8
6 NOV1990 133.8 120.1
7 DEC1990 133.8 118.7
8 JAN1991 134.6 119.0
9 FEB1991 134.8 117.2
10 MAR1991 135.0 116.2
11 APR1991 135.2 116.0
12 MAY1991 135.6 116.5
13 JUN1991 136.0 116.3
14 JUL1991 136.2 116.0
Figure 2.3: Time Series Data Set Containing Two Series


Standard Form of a Time Series Data Set

Several Series with Different Ranges

Missing Values and Omitted Observations

Cross-sectional Dimensions and BY Groups

Interleaved Time Series

Output Data Sets of SAS/ETS Procedures

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

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