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.

314 CREATE<br />

• The second span must be greater than or equal to 1 and less than or equal to the first span.<br />

• The second span should be even (or 1) if the first span is even; it should be odd if the first<br />

span is odd. Otherwise, the next higher span value will be used.<br />

• If no second span is specified, the minimum span is simply the value of the first span.<br />

• If the number of values specified for the span or the minimum span is not available, the<br />

case in the new series is set to system-missing. Thus, unless a minimum span of 1 is specified,<br />

the endpoints of the new series will contain system-missing values.<br />

• When RMED encounters an imbedded missing value in the existing series, it creates two<br />

subsets, one containing cases before the missing value and one containing cases after the<br />

missing value. Each subset is treated as a separate series for computational purposes.<br />

• The endpoints of these subset series will have missing values according to the rules described<br />

above for the endpoints of the entire series. Thus, if the minimum span is 1, the<br />

endpoints of the subsets will be nonmissing; the only cases that will be missing in the new<br />

series are cases that were missing in the original series.<br />

Example<br />

CREATE TICKRMED = RMED(TICKETS,4,2).<br />

• This example creates the series TICKRMED using centered running median values of the<br />

series TICKETS.<br />

• A span of 4 is used for computing medians. At the endpoints, where four values are not<br />

available, the median is based on the specified minimum of two values.<br />

SDIFF Function<br />

SDIFF produces new series based on seasonal differences of existing series.<br />

• The specification on SDIFF is the name or names of the existing series, the degree of differencing,<br />

and, optionally, the periodicity, all in parentheses.<br />

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

• Since the number of seasons used in the calculations decreases by 1 for each order of differencing,<br />

system-missing values will appear at the beginning of the new series.<br />

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

• If no periodicity is specified, the periodicity established on TSET PERIOD is in effect. If<br />

TSET PERIOD has not been specified, the periodicity established on the DATE command is<br />

used. If periodicity was not established anywhere, the SDIFF function cannot be executed.<br />

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

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

Example<br />

CREATE SDVAR = SDIFF(VARA,1,12).<br />

• The series SDVAR is created by applying one seasonal difference with a periodicity of 12<br />

to the series VARA.

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

Saved successfully!

Ooh no, something went wrong!