27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Example<br />

CREATE NEWVAR1 = DIFF(OLDVAR,1).<br />

CREATE 309<br />

• In this example, the series NEWVAR1 is created by taking the first-order difference of<br />

OLDVAR.<br />

CSUM Function<br />

CSUM produces new series based on the cumulative sums of the existing series. Cumulative<br />

sums are the inverse of first-order differencing.<br />

• The only specification on CSUM is the name or names of the existing series in parentheses.<br />

• Cases with missing values in the existing series are not used to compute values for the<br />

new series. The values of these cases are system-missing in the new series.<br />

Example<br />

CREATE NEWVAR1 NEWVAR2 = CSUM(TICKETS RNDTRP).<br />

• This example produces a new series called NEWVAR1, which is the cumulative sum of the<br />

series TICKETS, and a new series called NEWVAR2, which is the cumulative sum of the<br />

series RNDTRP.<br />

DIFF Function<br />

DIFF produces new series based on nonseasonal differences of existing series.<br />

• The specification on DIFF is the name or names of the existing series and the degree of<br />

differencing, in parentheses.<br />

• The degree of differencing must be specified; there is no default.<br />

• Since one observation is lost for each order of differencing, system-missing values will<br />

appear at the beginning of the new series.<br />

• You can specify only one degree of differencing per DIFF function.<br />

• If either of the pair of values involved in a difference computation is missing, the result<br />

is set to system-missing in the new series.<br />

Example<br />

CREATE ADIF2 = DIFF(VARA,2) /<br />

YDIF1 ZDIF1 = DIFF(VARY VARZ,1).<br />

• The series ADIF2 is created by differencing VARA twice.<br />

• The series YDIF1 is created by differencing VARY once.<br />

• The series ZDIF1 is created by differencing VARZ once.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!