Description:
Calculate Pearson’s correlation coefficient between two vectors.
Syntax:
pearson(A,B)
Note:
The function calculates the Pearson’s correlation coefficient between vector A and vector B. Default value of B is an integer sequence made up of numbers from 1 to vector A’s length.
Parameter:
A |
A vector |
B |
A vector |
Option:
@r |
Enable the calculation of r2, that is, pearson(norm@0(A),norm@0(B)) |
@a |
Equivalent to @a(…;k) that calculates the adjusted r2 with degrees of freedom being k |
Return value:
A numeric value
Example:
|
A |
|
1 |
=[3,5,2,8] |
|
2 |
=[4,6,2,4] |
|
3 |
=pearson(A1,A2) |
|
4 |
=pearson@r(A1,A2) |
|
5 |
=pearson@a(A1,A2;3) |
|
6 |
=pearson(A1) |
|