Skip to content

Commit 5e30e0e

Browse files
Add files via upload
1 parent 1cd38f7 commit 5e30e0e

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎CORRELATION TESTS/pearson_coeff.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from scipy.stats import pearsonr
2+
data1 = [0.873, 2.817, 0.121, -0.945, -0.055, -1.436, 0.360, -1.478, -1.637, -1.869]
3+
data2 = [0.353, 3.517, 0.125, -7.545, -0.555, -1.536, 3.350, -1.578, -3.537, -1.579]
4+
5+
stat, p = pearsonr(data1,data2)
6+
7+
print('stat=%.3f p=%.3f' % (stat,p))
8+
9+
if p > 0.05:
10+
print('Probably independent')
11+
else:
12+
print('Probably not independent')

0 commit comments

Comments
 (0)