• No results found

Numeric Functions

In document IBM SPSS Modeler 15 User s Guide (Page 148-150)

CLEM contains a number of commonly used numeric functions. Function Result Description

–NUM Number Used to negateNUM. Returns the corresponding number with

the opposite sign.

NUM1+NUM2 Number Returns the sum ofNUM1andNUM2.

code–NUM2 Number Returns the value ofNUM2subtracted fromNUM1.

NUM1*NUM2 Number Returns the value ofNUM1multiplied byNUM2.

NUM1/NUM2 Number Returns the value ofNUM1divided byNUM2.

INT1 div INT2 Number Used to perform integer division. Returns the value ofINT1 divided byINT2.

INT1 rem INT2 Number Returns the remainder ofINT1divided byINT2. For example,

INT1 – (INT1 div INT2) * INT2.

INT1 mod INT2 Number This function has been deprecated. Use theinstead. remfunction

BASE ** POWER Number

ReturnsBASEraised to the powerPOWER, where either may be any number (except thatBASEmust not be zero if POWERis zero of any type other than integer 0). IfPOWER is an integer, the computation is performed by successively multiplying powers ofBASE. Thus, ifBASEis an integer, the result will be an integer. IfPOWERis integer 0, the result is always a 1 of the same type asBASE. Otherwise, ifPOWER is not an integer, the result is computed asexp(POWER * log(BASE)).

abs(NUM) Number Returns the absolute value ofNUM, which is always a number of the same type.

exp(NUM) Real Returnseraised to the powerNUM, whereeis the base of natural logarithms.

fracof(NUM) Real Returns the fractional part of NUM, defined as

NUM–intof(NUM).

intof(NUM) Integer

Truncates its argument to an integer. It returns the integer of the same sign asNUMand with the largest magnitude such thatabs(INT) <= abs(NUM).

log(NUM) Real Returns the natural (basee) logarithm ofNUM, which must not be a zero of any kind.

log10(NUM) Real

Returns the base 10 logarithm ofNUM, which must not be a zero of any kind. This function is defined aslog(NUM) / log(10).

negate(NUM) Number Used to negateNUM. Returns the corresponding number with the opposite sign.

round(NUM) Integer Used to roundNUMto an integer by takingintof(NUM+0.5) if NUMis positive orintof(NUM–0.5)ifNUMis negative.

sign(NUM) Number

Used to determine the sign ofNUM. This operation returns –1, 0, or 1 ifNUMis an integer. IfNUMis a real, it returns –1.0, 0.0, or 1.0, depending on whetherNUMis negative, zero, or positive.

sqrt(NUM) Real Returns the square root ofNUM.NUMmust be positive.

sum_n(LIST) Number

Returns the sum of values from a list of numericfields or null if all of thefield values are null. For more information, see the topicSummarizing Multiple Fieldsin Chapter 7 on p. 115.

139 CLEM Language Reference Function Result Description

mean_n(LIST) Number Returns the mean value from a list of numericall of the fields or null if

field values are null.

sdev_n(LIST) Number Returns the standard deviation from a list of numericor null if all of the fields

field values are null.

Trigonometric Functions

All of the functions in this section either take an angle as an argument or return one as a result. In both cases, the units of the angle (radians or degrees) are controlled by the setting of the relevant stream option.

Function Result Description

arccos(NUM) Real Computes the arccosine of the specified angle.

arccosh(NUM) Real Computes the hyperbolic arccosine of the specified angle.

arcsin(NUM) Real Computes the arcsine of the specified angle.

arcsinh(NUM) Real Computes the hyperbolic arcsine of the specified angle.

arctan(NUM) Real Computes the arctangent of the specified angle.

arctan2(NUM_Y,

NUM_X) Real

Computes the arctangent ofNUM_Y / NUM_Xand uses the signs of the two numbers to derive quadrant information. The result is a real in the range- pi < ANGLE <= pi (radians) – 180 < ANGLE <= 180 (degrees)

arctanh(NUM) Real Computes the hyperbolic arctangent of the specified angle.

cos(NUM) Real Computes the cosine of the specified angle.

cosh(NUM) Real Computes the hyperbolic cosine of the specified angle.

pi Real This constant is the best real approximation to pi.

sin(NUM) Real Computes the sine of the specified angle.

sinh(NUM) Real Computes the hyperbolic sine of the specified angle.

tan(NUM) Real Computes the tangent of the specified angle.

tanh(NUM) Real Computes the hyperbolic tangent of the specified angle.

Probability Functions

Probability functions return probabilities based on various distributions, such as the probability that a value from Student’stdistribution will be less than a specific value.

Function Result Description

cdf_chisq(NUM, DF) Real

Returns the probability that a value from the chi-square distribution with the specified degrees of freedom will be less than the specified number.

cdf_f(NUM, DF1, DF2) Real

Returns the probability that a value from theF distribution, with degrees of freedomDF1andDF2, will be less than the specified number.

Function Result Description

cdf_normal(NUM, MEAN,

STDDEV) Real

Returns the probability that a value from the normal distribution with the specified mean and standard deviation will be less than the specified number.

cdf_t(NUM, DF) Real

Returns the probability that a value from Student’st distribution with the specified degrees of freedom will be less than the specified number.

In document IBM SPSS Modeler 15 User s Guide (Page 148-150)