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.

and<br />

COMPUTE lagvar=LAG(var1).<br />

EXECUTE.<br />

COMPUTE var1=var1*2.<br />

Transformation Expressions 53<br />

yield very different results for the value of lagvar, since the former uses the transformed value<br />

of var1 while the latter uses the original value.<br />

Missing-Value Functions<br />

• Each argument to a missing-value function (expression, variable name, or constant) must<br />

be separated by a comma.<br />

• Only numeric values can be used as arguments in missing-value functions.<br />

• The keyword TO can be used to refer to a set of variables in the argument list for functions<br />

NMISS and NVALID.<br />

• The functions MISSING and SYSMIS are logical functions and can be useful shortcuts to<br />

more complicated specifications on the IF, DO IF, and other conditional commands.<br />

VALUE(arg) Ignore user-defined missing values. The value is treated as is. The<br />

argument must be a variable name.<br />

MISSING(arg) True or 1 if the value is user-missing or system-missing; false or 0<br />

otherwise.<br />

SYSMIS(arg) True or 1 if the value is system-missing; false or 0 otherwise.<br />

NMISS(arg list) Number of system-missing values in the argument list.<br />

NVALID(arg list) Number of valid values in the argument list.<br />

Treatment of Missing Values in Arguments<br />

If the logic of an expression is indeterminate because of missing values, the expression<br />

returns a missing value, and the command is not executed. Table 6 summarizes how missing<br />

values are handled in arguments to various functions.<br />

Table 6 Missing values in arguments<br />

Function Returns system-missing if<br />

MOD (x1,x2) x1 is missing, or x2 is missing and x1 is not 0<br />

MAX.n (x1,x2,...xk) fewer than n arguments are valid; the default n is 1<br />

MEAN.n (x1,x2,...xk)<br />

MIN.n (x1,x2,...x1)<br />

SUM.n (x1,x2,...xk)

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

Saved successfully!

Ooh no, something went wrong!