SMEAN Function (RMV command)
SMEAN
replaces
missing values in the new variable with the variable mean.
- The only specification on
SMEAN
is a variable or variable list in parentheses. - The
SMEAN
function is equivalent to theMEAN
function with a span specification ofALL
.
Example
RMV VAR1 TO VAR4=SMEAN(VARA VARB VARC VARD).
- Four new variables (VAR1, VAR2, VAR3, and VAR4) are created.
- VAR1 copies the values of VARA, VAR2 copies VARB, VAR3 copies VARC, and VAR4 copies VARD. Any missing values in an existing variable are replaced with the mean of that variable.