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
... more lines ...
proc print data=usprice;
run;
Figure 3.4
Time Series Data Set Containing Two Series
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 |
Copyright © SAS Institute, Inc. All Rights Reserved.