Using Transformations
/*--------------------------------------------------------------
SAS Sample Library
Name: expex04.sas
Description: Example program from SAS/ETS User's Guide,
The EXPAND Procedure
Title: Using Transformations
Product: SAS/ETS Software
Keys: time series conversion and interpolation
PROC: EXPAND
Notes:
--------------------------------------------------------------*/
data test;
input year qtr x;
date = yyq( year, qtr );
format date yyqc.;
datalines;
1989 3 5238
1989 4 5289
1990 1 5375
1990 2 5443
1990 3 5514
1990 4 5527
1991 1 5557
1991 2 5615
;
proc expand data=test out=out method=none;
id date;
convert x = x_lag2 / transformout=(lag 2);
convert x = x_lag1 / transformout=(lag 1);
convert x;
convert x = x_lead1 / transformout=(lead 1);
convert x = x_lead2 / transformout=(lead 2);
convert x = x_movave / transformout=(movave 3);
run;
title "Transformed Series";
proc print data=out;
run;