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.

Domain Errors<br />

Transformation Expressions 45<br />

Domain errors occur when numeric expressions are mathematically undefined or cannot be<br />

represented numerically on the computer for reasons other than missing data. Two common<br />

examples are division by 0 and the square root of a negative number. When SPSS detects a<br />

domain error, it issues a warning and assigns the system-missing value to the expression. For<br />

example, the command COMPUTE TESTVAR = TRUNC(SQRT(X/Y) * .5) returns systemmissing<br />

if X/Y is negative or if Y is 0.<br />

The following are domain errors in numeric expressions:<br />

** A negative number to a non-integer power.<br />

/ A divisor of 0.<br />

MOD A divisor of 0.<br />

SQRT A negative argument.<br />

EXP An argument that produces a result too large to be represented on the computer.<br />

LG10 A negative or 0 argument.<br />

LN A negative or 0 argument.<br />

ARSIN An argument whose absolute value exceeds 1.<br />

NORMAL A negative or 0 argument.<br />

PROBIT A negative or 0 argument, or an argument 1 or greater.<br />

String Expressions<br />

Expressions involving string variables can be used on COMPUTE and IF commands and in<br />

logical expressions on commands such as IF, DO IF, LOOP IF, and SELECT IF.<br />

• A string expression can be a constant enclosed in apostrophes (for example, ‘IL’), a string<br />

function (see “String Functions” below), or a string variable.<br />

• An expression must return a string if the target variable is a string.<br />

• The string returned by a string expression does not have to be the same length as the<br />

target variable; no warning messages are issued if the lengths are not the same. If the<br />

target variable produced by a COMPUTE command is shorter, the result is right-trimmed.<br />

If the target variable is longer, the result is right-padded.<br />

String Functions<br />

• The target variable for each string function must be a string and must have already been<br />

declared (see STRING).<br />

• Multiple arguments in a list must be separated by commas.

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

Saved successfully!

Ooh no, something went wrong!