SUMSQRDEV inputVector inputVector resultVariable

Replaces the result variable with the sum of the squared deviations of the first input vector's elements versus the second vector's elements.

If the input vectors are of different lengths, the shorter vector will be "extended" to the length of the longer by repeating its last element as many times as necessary. This extension is only done internally and does not change the actual size or content of the shorter vector.

If any element is a "missing" value (represented by a "." Or "NaN") the result for SUMSQRDEV will be NaN. To avoid this, you can CLEAN the input vector(s) before applying the SUMABSDEV command.

COPY 1,5 A
SUMSQRDEV A 2 B
PRINT A B

The above program produces the following output:

A: (1.0 2.0 3.0 4.0 5.0)
B: 15.0