-
Notifications
You must be signed in to change notification settings - Fork 0
/
Correlation_plot_LB_UB.py
289 lines (266 loc) · 4.41 KB
/
Correlation_plot_LB_UB.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 10 10:57:08 2019
@author: weiyong
"""
LB=[
7.75,
10.58,
8.67,
10.67,
7.92,
10.58,
8.33,
8.92,
8.00,
10.50,
10.50,
6.42,
8.67,
9.33,
11.33,
7.75,
8.50,
9.33,
6.75,
8.00,
9.08,
9.42,
6.50,
5.83,
8.33,
7.00,
8.50,
5.75,
11.33,
9.83
]
UB=[
8.67,
9.58,
10.25,
10.50,
5.42,
11.50,
8.58,
10.67,
10.75,
8.92,
10.50,
8.17,
7.25,
5.83,
11.33,
8.83,
8.67,
7.75,
6.33,
5.25,
10.33,
9.67,
8.50,
2.58,
6.92,
7.83,
6.17,
8.58,
10.25,
11.10
]
Digits_SPAN=[
27.00,
42.00,
28.00,
33.00,
33.00,
32.00,
28.00,
29.00,
32.00,
30.00,
28.00,
30.00,
27.00,
26.00,
38.00,
30.00,
31.00,
30.00,
36.00,
26.00,
22.00,
31.00,
26.00,
29.00,
30.00,
31.00,
34.00,
28.00,
44.00,
30.00
]
RAN_LETTER=[
13.00,
14.00,
14.00,
10.00,
14.00,
13.00,
20.00,
14.00,
16.00,
21.00,
19.00,
17.00,
20.00,
19.00,
15.00,
16.00,
21.00,
23.00,
24.00,
18.00,
17.00,
15.00,
27.00,
15.00,
17.00,
29.00,
17.00,
25.00,
14.00,
21.00
]
RAN_OBJECT=[
27.00,
24.00,
27.00,
29.00,
33.00,
23.00,
36.00,
31.00,
29.00,
33.00,
26.00,
31.00,
38.00,
35.00,
30.00,
26.00,
33.00,
35.00,
37.00,
40.00,
31.00,
29.00,
35.00,
39.00,
32.00,
35.00,
37.00,
30.00,
27.00,
34.00
]
PP=[
51.00,
53.00,
51.00,
51.00,
52.00,
53.00,
51.00,
52.00,
53.00,
50.00,
51.00,
51.00,
52.00,
49.00,
52.00,
53.00,
52.00,
52.00,
52.00,
51.00,
52.00,
53.00,
52.00,
50.00,
52.00,
53.00,
52.00,
52.00,
53.00,
53.00
]
import pandas as pd
import numpy as np
df=pd.DataFrame(np.array([LB,UB,Digits_SPAN,RAN_LETTER,RAN_OBJECT,PP])).transpose()
df.columns=['Learning Speed LB','Learning Speed UB','Digits Span','RAN Letters','RAN Objects','Phonological Processing']
from scipy.stats import linregress
b1, i1, r1, p1, std1 = linregress(df['Learning Speed UB'],df['Digits Span'])
b2, i2, r2, p2, std2 = linregress(df['Learning Speed UB'],df['RAN Letters'])
b3, i3, r3, p3, std3 = linregress(df['Learning Speed UB'],df['RAN Objects'])
b4, i4, r4, p4, std4 = linregress(df['Learning Speed UB'],df['Phonological Processing'])
from scipy.stats import linregress
b5, i5, r5, p5, std5 = linregress(df['Learning Speed LB'],df['Digits Span'])
b6, i6, r6, p6, std6 = linregress(df['Learning Speed LB'],df['RAN Letters'])
b7, i7, r7, p7, std7 = linregress(df['Learning Speed LB'],df['RAN Objects'])
b8, i8, r8, p8, std8 = linregress(df['Learning Speed LB'],df['Phonological Processing'])
import matplotlib.pyplot as plt
f = plt.figure()
f.set_size_inches((16, 8))
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(font_scale=1.6)
ax = plt.subplot(241)
sns.regplot('Learning Speed UB','Digits Span',df)
text = f"$r={round(r1, 4)}$\n$p={round(p1, 4)}$"
plt.text(4, 40, text,fontsize=16)
plt.xlabel('Learning Speed')
#plt.xlim([2,12])
plt.tight_layout()
ax = plt.subplot(242)
sns.regplot('Learning Speed UB','RAN Letters',df)
text = f"$r={round(r2, 4)}$\n$p={round(p2, 4)}$"
plt.text(2.5, 25, text,fontsize=16)
plt.xlabel('Learning Speed')
plt.tight_layout()
ax = plt.subplot(243)
sns.regplot('Learning Speed UB','RAN Objects',df)
text = f"$r={round(r3, 4)}$\n$p={round(p3, 5)}$"
plt.text(6, 40, text,fontsize=16,color='red')
plt.xlabel('Learning Speed')
plt.tight_layout()
ax = plt.subplot(244)
sns.regplot('Learning Speed UB','Phonological Processing',df)
text = f"$r={round(r4, 4)}$\n$p={round(p4, 4)}$"
plt.text(3, 52.5, text,fontsize=16,color='red')
plt.xlabel('Learning Speed')
plt.tight_layout()
ax = plt.subplot(245)
sns.regplot('Learning Speed LB','Digits Span',df)
text = f"$r={round(r5, 4)}$\n$p={round(p5, 4)}$"
plt.text(6, 40, text,fontsize=16,color='red')
plt.xlabel('Learning Speed')
plt.tight_layout()
ax = plt.subplot(246)
sns.regplot('Learning Speed LB','RAN Letters',df)
text = f"$r={round(r6, 4)}$\n$p={round(p6, 4)}$"
plt.text(7.5, 26, text,fontsize=16,color='red')
plt.xlabel('Learning Speed')
plt.tight_layout()
ax = plt.subplot(247)
sns.regplot('Learning Speed LB','RAN Objects',df)
text = f"$r={round(r7, 4)}$\n$p={round(p7, 4)}$"
plt.text(8.7, 37.5, text,fontsize=16,color='red')
plt.xlabel('Learning Speed')
plt.tight_layout()
ax = plt.subplot(248)
sns.regplot('Learning Speed LB','Phonological Processing',df)
text = f"$r={round(r8, 4)}$\n$p={round(p8, 4)}$"
plt.text(7, 50, text,fontsize=16)
plt.xlabel('Learning Speed')
plt.tight_layout()