Working with Time Series Data |
Several Series with Different Ranges |
Different time series can have values recorded over different time ranges. Since a SAS data set must have the same observations for all variables, when time series with different ranges are stored in the same data set, missing values must be used for the periods in which a series is not available.
Suppose that in the previous example you did not record values for CPI before August 1990 and did not record values for PPI after June 1991. The USPRICE data set could be read with the following statements:
data usprice; input date : monyy7. cpi ppi; format date monyy7.; datalines; jun1990 . 114.3 jul1990 . 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 . ;
The decimal points with no digits in the data records represent missing data and are read by SAS as missing value codes.
In this example, the time range of the USPRICE data set is June 1990 through July 1991, but the time range of the CPI variable is August 1990 through July 1991, and the time range of the PPI variable is June 1990 through June 1991.
SAS/ETS procedures ignore missing values at the beginning or end of a series. That is, the series is considered to begin with the first nonmissing value and end with the last nonmissing value.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.