annotate bin/spearman.py @ 25:50337cd1d16f

framework for stats over results of rank correlations
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Mon, 14 Nov 2022 18:52:35 +0000
parents
children 5c5440e7854a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
25
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
1 #!/usr/bin/env python3
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
2 import numpy as np
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
3 from numpy import loadtxt
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
4 from scipy import stats
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
5 import statsmodels.api as sm
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
6 import pylab
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
7
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
8 import sys
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
9
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
10 cc19=loadtxt(sys.argv[1],delimiter=',')
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
11 cc19s_o=stats.spearmanr(cc19,nan_policy='omit')
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
12 cc19s_x=np.array([np.concatenate((cc19s_o.correlation[i][1:i],cc19s_o.correlation[i][i+1:])) for i in range(1,101)])
50337cd1d16f framework for stats over results of rank correlations
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
diff changeset
13