Differencing

Differencing of the response series is specified with the VAR= option of the IDENTIFY statement by placing a list of differencing periods in parentheses after the variable name. For example, to take a simple first difference of the series `SALES`, use the statement

```      identify var=sales(1);
```

In this example, the change in `SALES` from one period to the next is analyzed.

A deterministic seasonal pattern also causes the series to be nonstationary, since the expected value of the series is not the same for all time periods but is higher or lower depending on the season. When the series has a seasonal pattern, you might want to difference the series at a lag that corresponds to the length of the seasonal cycle. For example, if `SALES` is a monthly series, the statement

```      identify var=sales(12);
```

takes a seasonal difference of `SALES`, so that the series analyzed is the change in `SALES` from its value in the same month one year ago.

To take a second difference, add another differencing period to the list. For example, the following statement takes the second difference of `SALES`:

```      identify var=sales(1,1);
```

That is, `SALES` is differenced once at lag 1 and then differenced again, also at lag 1. The statement

```      identify var=sales(2);
```

creates a 2-span difference—that is, current period `SALES` minus `SALES` from two periods ago. The statement

```      identify var=sales(1,12);
```

takes a second-order difference of `SALES`, so that the series analyzed is the difference between the current period-to-period change in `SALES` and the change 12 periods ago. You might want to do this if the series had both a trend over time and a seasonal pattern.

There is no limit to the order of differencing and the degree of lagging for each difference.

Differencing not only affects the series used for the IDENTIFY statement output but also applies to any following ESTIMATE and FORECAST statements. ESTIMATE statements fit ARMA models to the differenced series. FORECAST statements forecast the differences and automatically sum these differences back to undo the differencing operation specified by the IDENTIFY statement, thus producing the final forecast result.

Differencing of input series is specified by the CROSSCORR= option and works just like differencing of the response series. For example, the statement

```      identify var=y(1) crosscorr=(x1(1) x2(1));
```

takes the first difference of Y, the first difference of X1, and the first difference of X2. Whenever X1 and X2 are used in INPUT= options in following ESTIMATE statements, these names refer to the differenced series.