Standard Library function that calculates a simplecorrelation coefficient for two arrays.
y The Y array for which the correlation coefficient is calculated. Can be of any data type except string and it must be of the same data type and have the same number of elements as x.
Correlation can be characterized as the probability that values (i.e., the two input arrays) are related. In other words, it measures whether the events in one population are likely to have produced effects in another population. A result of 1.0 indicates a high correlation, while a result of 0.0 indicates no correlation whatsoever.
scores_1 = [95,76,60,88,91,97,68,75,82,85] scores_2 = [93,77,62,87,90,97,67,77,80,86] scores_corr = CORRELATE(scores_1, scores_2) PRINT, scores_corr
.993408
sample_1 = RANDOMU(seed, 128, 128) sample_2 = RANDOMU(seed, 128, 128) samples_corr = CORRELATE(sample_1, sample_2) PRINT, samples_corr
0.00
x = DIST(200) y = x exact_corr = CORRELATE(x, y) PRINT, exact_corr
1.0000