RMS Function

Returns the root mean square.

Category: Descriptive Statistics
Returned data type: DOUBLE

Syntax

RMS(expression [, ...expression])

Arguments

expression

specifies any valid expression that evaluates to a numeric value.

Data type DOUBLE
See <sql-expression>
FedSQL Expressions

Details

The root mean square is the square root of the arithmetic mean of the squares of the values. If all the arguments are null or missing values, then the result is a null or missing value. Otherwise, the result is the root mean square of the non-null or nonmissing values.
Let n  be the number of arguments with non-null or nonmissing values, and let x sub 1 , comma , x sub 2 , comma dot dot dot comma , x sub n  be the values of those arguments. The root mean square is calculated as follows.
table with 1 row and 1 column , row1 column 1 , square root of fraction x sub 1 and super 2 , plus , x sub 2 and super 2 , plus dot dot dot plus , x sub n and super 2 , over n end fraction end root , end table

Example

The following statements illustrate the RMS function:
Statements
Results
select rms(1,7);
5
select rms(.,1,5,11);
7