WebCab Probability and Statistics for Delphi (COM) v3.6

Correlation.PearsonCorrelation Method 

Calculates Pearson's correlation coefficient of a set of pairs of points: (xValues[0], yValues[0]), (xValues[1], yValues[1]),... , (xValues[n], yValues[n]).

public double PearsonCorrelation(
   double[] xValues,
   double[] yValues
);

Parameters

xValues
The values of the first elements within the pairs.
yValues
The values of the second elements within the pairs.

Remarks

Example

Within this worked example we compare our results with the results given by the CORREL function from Excel.

Data Set 112345678910
Data Set 21.122.31.23.492.189.1-2
Data Set 3-122.343.82.17.28.29.510.2
Data Set 412345678910
Data Set 5-1-2-3-4-5-6-7-8-9-10
Data Set 61.21.43.24.55.36.77.18.29.410.2
Data Set 71002003004005006007008009001000
Data Set 8562812365147
Data Set 9227857234936
Data Set 1083123472365

ResultsExcel CORREL
Results
WebCab
Results
Data Set1
Data Set 2
0.2843752990.284375299
Data Set1
Data Set 3
0.9381129680.938112968
Data Set1
Data Set 4
11
Data Set1
Data Set 5
-1-1
Data Set1
Data Set 6
0.9948633610.994863361
Data Set1
Data Set 7
11
Data Set1
Data Set 8
0.1543720660.154372066
Data Set1
Data Set 9
-0.227156827-0.227156827
Data Set1
Data Set 10
-0.306136567-0.306136567

See Also

Correlation Class | WebCab.COM.Statistics.Correlation Namespace