-
Notifications
You must be signed in to change notification settings - Fork 0
/
MannWhitney.py
45 lines (41 loc) · 3.14 KB
/
MannWhitney.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*- coding: utf-8 -*-
# @Time : 2023/4/10 17:51 17
# @Author : ZiHan Wang
# @Email : [email protected]
# @File : MannWhitney.py
# @Software: PyCharm
import scipy.stats as stats
Psmall = [0.5448, 0.3047, 0.8033, 0.2482, 0.5239, 0.4888, 0.4449,
0.4109,0.4775, 0.3282, 0.6851, 0.2745, 0.7161, 0.6182, 0.5976, 0.5001,0.4446, 0.3379, 0.3901, 0.1402, 0.3366, 0.3433, 0.3489, 0.3154,0.5401, 0.3406, 0.7083, 0.3143, 0.3301, 0.3324, 0.3280, 0.3105,0.5742, 0.3217, 0.7955, 0.1421, 0.4418, 0.4504, 0.4450, 0.386]
Rsmall = [0.4224, 0.9661, 0.6777, 0.9588, 0.9095, 0.9397, 0.9267, 0.9658,
0.5124, 0.9344, 0.7948, 0.9431, 0.6921, 0.7605, 0.8156, 0.9289,
0.7757, 0.8697, 0.8473, 0.8737, 0.8646, 0.8512, 0.8512, 0.8988,
0.2882, 0.8972, 0.4425, 0.8519, 0.9162, 0.9123, 0.9201, 0.9335,
0.3310, 0.9413, 0.5515, 0.9086, 0.9162, 0.9162, 0.9292, 0.9504]
Fsmall = [0.4438, 0.4570, 0.7126, 0.3835, 0.6383, 0.6185, 0.5796, 0.5551,
0.4598, 0.4660, 0.7159, 0.3993, 0.6864, 0.6716, 0.6723, 0.6253,
0.5301, 0.4731, 0.5245, 0.2254, 0.4764, 0.4827, 0.4888, 0.4870,
0.3394, 0.4879, 0.5105, 0.4416, 0.4802, 0.4816, 0.4782, 0.4595,
0.3854, 0.4652, 0.6211, 0.2392, 0.5868, 0.5937, 0.5923, 0.5343]
Pbig = [0.0478, 0.0889, 0.0600, 0.0917, 0.0933, 0.0866, 0.0908, 0.0863,
0.0697, 0.0843, 0.1086, 0.0919, 0.0930, 0.0851, 0.0893, 0.0913,
0.0330, 0.0899, 0.0968, 0.0910, 0.0987, 0.0837, 0.0814, 0.0838,
0.0000, 0.0928, 0.0000, 0.0908, 0.1001, 0.0861, 0.0836, 0.0842,
0.0000, 0.0929, 0.0000, 0.0889, 0.0995, 0.0895, 0.0853, 0.0835]
Rbig = [0.0131, 0.5398, 0.0214, 0.8537, 0.2361, 0.2643, 0.2966, 0.3830,
0.0956, 0.5201, 0.1245, 0.9034, 0.0912, 0.1772, 0.2041, 0.3075,
0.0170, 0.4602, 0.0143, 0.7534, 0.4837, 0.7473, 0.7395, 0.8051,
0.0000, 0.4616, 0.0000, 0.7724, 0.4867, 0.6017, 0.5915, 0.9316,
0.0000, 0.5177, 0.0000, 0.8048, 0.4575, 0.4976, 0.5000, 0.7435]
Fbig = [0.0198, 0.1369, 0.0316, 0.1522, 0.1333, 0.1247, 0.1309, 0.1354,
0.0798, 0.1303, 0.1157, 0.1537, 0.0918, 0.1098, 0.1176, 0.1328,
0.0158, 0.0966, 0.0249, 0.1470, 0.0978, 0.1383, 0.1354, 0.1413,
0.0000, 0.1338, 0.0000, 0.1487, 0.1427, 0.1323, 0.1292, 0.1460,
0.0000, 0.2227, 0.0000, 0.1466, 0.1387, 0.1310, 0.1270, 0.1393]
print("P值使用Mann-Whitney U检验的U值为:",stats.mannwhitneyu(Psmall,Pbig,alternative='two-sided')[0])
print("R值使用Mann-Whitney U检验的U值为:",stats.mannwhitneyu(Rsmall,Rbig,alternative='two-sided')[0])
print("F值使用Mann-Whitney U检验的U值为:",stats.mannwhitneyu(Fsmall,Fbig,alternative='two-sided')[0])
print("P值使用Mann-Whitney U检验的显著性水平为:",stats.mannwhitneyu(Psmall,Pbig,alternative='two-sided')[1])
print("R值使用Mann-Whitney U检验的显著性水平为:",stats.mannwhitneyu(Rsmall,Rbig,alternative='two-sided')[1])
print("F值使用Mann-Whitney U检验的显著性水平为:",stats.mannwhitneyu(Fsmall,Fbig,alternative='two-sided')[1])
# stats.mannwhitneyu(weight_high,weight_low,alternative='two-sided')