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 TICKMA = MA(TICKETS,4,2).<br />

CREATE 313<br />

• This example creates the series TICKMA based on centered moving average values of the<br />

series TICKETS.<br />

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

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

PMA Function<br />

PMA creates new series based on the prior moving averages of existing series. The prior<br />

moving average for each case in the original series is computed by averaging the values of a<br />

span of cases preceding it.<br />

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

used, in parentheses.<br />

• Only one span can be specified and it is required. There is no default span.<br />

• If the number of values specified for the span is not available, the case is set to systemmissing.<br />

Thus, the number of cases with system-missing values at the beginning of the<br />

new series equals the number specified for the span.<br />

• When PMA 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. The<br />

first n cases in the second subset will be system-missing, where n is the span.<br />

Example<br />

CREATE PRIORA = PMA(VARA,3).<br />

• This command creates series PRIORA by computing prior moving averages for series<br />

VARA. Since the span is 3, the first three cases in series PRIORA are system-missing. The<br />

fourth case equals the average of cases 1, 2, and 3 of VARA, the fifth case equals the average<br />

of cases 2, 3, and 4 of VARA, and so on.<br />

RMED Function<br />

RMED produces new series based on the centered running medians of existing series.<br />

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

used in finding the median, in parentheses.<br />

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

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

even, the RMED is centered by averaging each pair of uncentered medians (Velleman and<br />

Hoaglin, 1981).<br />

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

values to use in finding the median 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<br />

new series.

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

Saved successfully!

Ooh no, something went wrong!