**Example 7: Moving Averages**

If the program data vector is set to missing at every observation, how do you "__look back__"?

Data moving;

Set old;

X1 = LAG(X);

X2 = LAG2(X);

AVE= MEAN (OF X X1 X2);

IF _N_>3 then OUTPUT;

RUN;