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.

1440 RMV<br />

• NEWVAR1 will have the same values as OLDVAR1 but with missing values replaced by<br />

linear interpolation.<br />

MEAN Function<br />

MEAN replaces missing values with the mean of valid surrounding values. The number of<br />

surrounding values used to compute the mean depends on the span.<br />

• The specification on MEAN is a variable or variable list and a span, in parentheses.<br />

• The span specification is optional and can be any positive integer or keyword ALL.<br />

• A span of n uses n valid cases before and after the missing value.<br />

• If span is not specified, it defaults to 2.<br />

• Keyword ALL computes the mean of all valid values.<br />

• MEAN will not replace missing values if there are not enough valid surrounding cases to<br />

satisfy the span specification.<br />

Example<br />

RMV B=MEAN(A,3).<br />

• This example produces a new variable called B.<br />

• B will have the same values as variable A but with missing values replaced by means of<br />

valid surrounding values.<br />

• Each mean is based on 6 values, that is, the 3 nearest valid values on each side of the<br />

missing value.<br />

MEDIAN Function<br />

MEDIAN replaces missing values with the median of valid surrounding values. The number<br />

of surrounding values used to compute the median depends on the span.<br />

• The specification on MEDIAN is a variable or variable list and a span, in parentheses.<br />

• The span specification is optional and can be any positive integer or keyword ALL.<br />

• A span of n uses n valid cases before and after the missing value.<br />

• If span is not specified, it defaults to 2.<br />

• Keyword ALL computes the median of all valid values.<br />

• MEDIAN will not replace missing values if there are not enough valid surrounding cases<br />

to satisfy the span specification.<br />

Example<br />

RMV B=MEDIAN(A,3).<br />

• This example produces a new variable called B.<br />

• B will have the same values as A but with missing values replaced by medians of valid<br />

surrounding values.

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

Saved successfully!

Ooh no, something went wrong!