Lag or lead (LAG#)

Lag or lead (LAG#)

This lags (or leads) a time series to enable comparisons with other time series. This function is of particular use when performing regressions, but you can apply it to any series.

Format

LAG#(Expression,Period,Parameter)

Where Period may take any of the time period formats. and may be:

Parameter can be M for recalculating the number of days to use for say 1M in every calculation of a one month lag.

Parameter ME is as for M with the addition that end of month values are used when requesting a lag or lead at an end of month date.

Examples

LAG#(UKIPDMRO,6M)

This function returns the IPD rental index for UK offices lagged by six calendar months. For example, a data series rising to a peak in October 1990 is presented as peaking in April 1991.

To achieve a lead effect, use a negative time period:

LAG#(UKIPDMRO,-6M)

This function returns the same data series as rising to an April 1990 peak, six months before the actual peak.

Warning

You must use a lag/lead period that is consistent with the frequency of the stored data. That is, the Period frequency you request for the function can be greater but not less than the data frequency. For example:

LAG#(UKBCJD..,30D)

is invalid because UK unemployment is a monthly data series, so you cannot calculate a lag/lead using a daily time period.

Note You can use LAG# with a maximum of 4,000 values. If you request a lag/lead period which requires more than 4,000 values, an error message is displayed. To reduce the number of values, either reduce the display period or the lag/lead period. These time periods should not exceed 15 years.