Home · Command reference

RainbowStats™ · Command reference

DIFF — First differences

Calculate changes between consecutive observations.

Syntax

DIFF(series)
DIFF(seriesList)

Inputs and results

A series returns first differences. A series list returns a list with each series differenced separately.

Example

x = SERIES_SINCE(UNRATE,20010101)
LINE_CHART(DIFF(x))

Notes and interpretation

DIFF(x)[t] = x[t] - x[t-1]. Results retain the original units. For a rate recorded in percent, differences are percentage points. The first observation has no preceding value within the input sample. This command has one argument; use LOGDIFF(series,n) for explicit-lag log changes.

Learn more

Detailed guide and examples