The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: none
Declaration: function PearsonCorrCoeff (Data1, Data2: TDoubleArray; var CorrCoeff: double): integer;

The function PearsonCorrCoeff calculates Pearson's correlation coefficient of the two data sets Data1 and Data2 and returns it in the variable parameter CorrCoeff.

The function returns the following error codes:

 0 ... everything is OK
-1 ... too few data values (a minimum of 3 data pairs are required)
-2 ... data arrays do not match in size

Last Update: 2023-Feb-06