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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

312 CREATE<br />

• Two lead orders indicate a range. For example, 1,5 indicates lead orders one through five.<br />

A new series is created for each lead order in the range.<br />

• The number of new series must equal the number of existing series specified times the<br />

number of lead orders in the range.<br />

• The last n cases at the end of the new series, where n equals the lead order, are assigned<br />

the system-missing value.<br />

• Missing values in the existing series are moved back and are assigned the system-missing<br />

value in the new series.<br />

Example<br />

CREATE LEAD1 TO LEAD4 = LEAD(VARA,1,4).<br />

• Four new series are created based on leads of VARA. LEAD1 is VARA led one step, LEAD2<br />

is VARA led two steps, LEAD3 is VARA led three steps, and LEAD4 is VARA led four steps.<br />

MA Function<br />

MA produces new series based on the centered moving averages of existing series.<br />

• The specification on MA is the name or names of the existing series and the span to be<br />

used in averaging, in parentheses.<br />

• A span must be specified; there is no default.<br />

• If the specified span is odd, the MA is naturally associated with the middle term. If the<br />

specified span is even, the MA is centered by averaging each pair of uncentered means<br />

(Velleman and Hoaglin, 1981).<br />

• After the initial span, a second span can be specified to indicate the minimum number of<br />

values to use in averaging when the number specified for the initial span is unavailable.<br />

This makes it possible to produce nonmissing values at or near the ends of the new series.<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 MA encounters an imbedded missing value in the existing series, it creates two subsets,<br />

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.

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

Saved successfully!

Ooh no, something went wrong!