Chapter Contents |
Previous |
Next |
The EXPAND Procedure |
One important use of PROC EXPAND is to combine time series measured at different sampling frequencies. For example, suppose you have data on monthly money stocks (M1), quarterly gross domestic product (GDP), and weekly interest rates (INTEREST), and you want to perform an analysis of a model that uses all these variables. To perform the analysis, you first need to convert the series to a common frequency and combine the variables into one data set.
The following statements illustrate this process for the three data sets QUARTER, MONTHLY, and WEEKLY. The data sets QUARTER and WEEKLY are converted to monthly frequency using two PROC EXPAND steps, and the three data sets are then merged using a DATA step MERGE statement to produce the data set COMBINED.
proc expand data=quarter out=temp1 from=qtr to=month; id date; convert gdp / observed=total; run; proc expand data=weekly out=temp2 from=week to=month; id date; convert interest / observed=average; run; data combined; merge monthly temp1 temp2; by date; run;
See Chapter 2, "Working with Time Series Data,", for further discussion of time series periodicity, time series dating, and time series interpolation.
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.