DIFF Function (CREATE command)

DIFF produces new series based on nonseasonal differences of existing series.

  • The specification on DIFF is the name or names of the existing series and the degree of differencing, in parentheses.
  • The degree of differencing must be specified; there is no default.
  • Since one observation is lost for each order of differencing, system-missing values will appear at the beginning of the new series.
  • You can specify only one degree of differencing per DIFF function.
  • If either of the pair of values involved in a difference computation is missing, the result is set to system-missing in the new series.

Example

CREATE ADIF2 = DIFF(VARA,2) /
       YDIF1 ZDIF1 = DIFF(VARY VARZ,1).
  • The series ADIF2 is created by differencing VARA twice.
  • The series YDIF1 is created by differencing VARY once.
  • The series ZDIF1 is created by differencing VARZ once.