AutoStatLib 0.2.18__tar.gz → 0.2.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of AutoStatLib might be problematic. Click here for more details.
- {autostatlib-0.2.18/src/AutoStatLib.egg-info → autostatlib-0.2.21}/PKG-INFO +23 -23
- {autostatlib-0.2.18 → autostatlib-0.2.21}/README.md +22 -22
- {autostatlib-0.2.18 → autostatlib-0.2.21}/pyproject.toml +1 -1
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/AutoStatLib.py +27 -7
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/StatPlots.py +46 -44
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/_version.py +1 -1
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/helpers.py +1 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/text_formatting.py +2 -2
- {autostatlib-0.2.18 → autostatlib-0.2.21/src/AutoStatLib.egg-info}/PKG-INFO +23 -23
- {autostatlib-0.2.18 → autostatlib-0.2.21}/LICENSE +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/MANIFEST.in +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/requirements.txt +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/setup.cfg +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/__init__.py +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/__main__.py +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/normality_tests.py +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib/statistical_tests.py +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib.egg-info/SOURCES.txt +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib.egg-info/dependency_links.txt +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib.egg-info/requires.txt +0 -0
- {autostatlib-0.2.18 → autostatlib-0.2.21}/src/AutoStatLib.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AutoStatLib
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.21
|
|
4
4
|
Summary: AutoStatLib - a simple statistical analysis tool
|
|
5
5
|
Author: Stemonitis, SciWare LLC
|
|
6
6
|
Author-email: konung-yaropolk <yaropolk1995@gmail.com>
|
|
@@ -659,39 +659,39 @@ If errors occured, *GetResult()* returns an empty dictionary
|
|
|
659
659
|
|
|
660
660
|
---
|
|
661
661
|
|
|
662
|
-
##
|
|
662
|
+
## Alpha dev status.
|
|
663
663
|
|
|
664
664
|
### TODO:
|
|
665
665
|
|
|
666
|
-
-- Anova: posthocs
|
|
667
|
-
-- Anova: add 2-way anova and 3-way anova
|
|
668
|
-
-- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
|
|
669
|
-
-- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
|
|
670
|
-
-- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
|
|
671
|
-
-- add Welch test (for norm data unequal variances)
|
|
672
|
-
-- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
|
|
673
|
-
-- add independent t-test with Welch correction (do not assume equal SDs in groups)
|
|
674
|
-
-- add correlation test, correlation diagram
|
|
675
|
-
-- add linear regression, regression diagram
|
|
666
|
+
-- Anova: posthocs
|
|
667
|
+
-- Anova: add 2-way anova and 3-way anova
|
|
668
|
+
-- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
|
|
669
|
+
-- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
|
|
670
|
+
-- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
|
|
671
|
+
-- add Welch test (for norm data unequal variances)
|
|
672
|
+
-- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
|
|
673
|
+
-- add independent t-test with Welch correction (do not assume equal SDs in groups)
|
|
674
|
+
-- add correlation test, correlation diagram
|
|
675
|
+
-- add linear regression, regression diagram
|
|
676
676
|
-- add QQ plot
|
|
677
677
|
-- n-sample tests: add onetail option
|
|
678
678
|
|
|
679
679
|
✅ done -- detailed normality test results
|
|
680
680
|
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
681
681
|
|
|
682
|
-
tests check:
|
|
683
|
-
1-sample:
|
|
682
|
+
tests check:
|
|
683
|
+
1-sample:
|
|
684
684
|
✅ok --Wilcoxon 2,1 tails
|
|
685
|
-
✅ok --t-tests 2,1 tails
|
|
685
|
+
✅ok --t-tests 2,1 tails
|
|
686
686
|
|
|
687
|
-
2-sample:
|
|
687
|
+
2-sample:
|
|
688
688
|
✅ok --Wilcoxon 2,1 tails
|
|
689
|
-
✅ok --Mann-whitney 2,1 tails
|
|
690
|
-
✅ok --t-tests 2,1 tails
|
|
689
|
+
✅ok --Mann-whitney 2,1 tails
|
|
690
|
+
✅ok --t-tests 2,1 tails
|
|
691
691
|
|
|
692
|
-
n-sample:
|
|
692
|
+
n-sample:
|
|
693
693
|
✅ok --Kruskal-Wallis 2 tail
|
|
694
|
-
✅ok --Dunn's multiple comparisons
|
|
695
|
-
✅ok --Friedman 2 tail
|
|
696
|
-
✅ok --one-way
|
|
697
|
-
✅ok --Tukey`s multiple comparisons
|
|
694
|
+
✅ok --Dunn's multiple comparisons
|
|
695
|
+
✅ok --Friedman 2 tail
|
|
696
|
+
✅ok --one-way ANOVA 2-tailed
|
|
697
|
+
✅ok --Tukey`s multiple comparisons
|
|
@@ -119,39 +119,39 @@ If errors occured, *GetResult()* returns an empty dictionary
|
|
|
119
119
|
|
|
120
120
|
---
|
|
121
121
|
|
|
122
|
-
##
|
|
122
|
+
## Alpha dev status.
|
|
123
123
|
|
|
124
124
|
### TODO:
|
|
125
125
|
|
|
126
|
-
-- Anova: posthocs
|
|
127
|
-
-- Anova: add 2-way anova and 3-way anova
|
|
128
|
-
-- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
|
|
129
|
-
-- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
|
|
130
|
-
-- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
|
|
131
|
-
-- add Welch test (for norm data unequal variances)
|
|
132
|
-
-- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
|
|
133
|
-
-- add independent t-test with Welch correction (do not assume equal SDs in groups)
|
|
134
|
-
-- add correlation test, correlation diagram
|
|
135
|
-
-- add linear regression, regression diagram
|
|
126
|
+
-- Anova: posthocs
|
|
127
|
+
-- Anova: add 2-way anova and 3-way anova
|
|
128
|
+
-- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
|
|
129
|
+
-- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
|
|
130
|
+
-- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
|
|
131
|
+
-- add Welch test (for norm data unequal variances)
|
|
132
|
+
-- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
|
|
133
|
+
-- add independent t-test with Welch correction (do not assume equal SDs in groups)
|
|
134
|
+
-- add correlation test, correlation diagram
|
|
135
|
+
-- add linear regression, regression diagram
|
|
136
136
|
-- add QQ plot
|
|
137
137
|
-- n-sample tests: add onetail option
|
|
138
138
|
|
|
139
139
|
✅ done -- detailed normality test results
|
|
140
140
|
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
141
141
|
|
|
142
|
-
tests check:
|
|
143
|
-
1-sample:
|
|
142
|
+
tests check:
|
|
143
|
+
1-sample:
|
|
144
144
|
✅ok --Wilcoxon 2,1 tails
|
|
145
|
-
✅ok --t-tests 2,1 tails
|
|
145
|
+
✅ok --t-tests 2,1 tails
|
|
146
146
|
|
|
147
|
-
2-sample:
|
|
147
|
+
2-sample:
|
|
148
148
|
✅ok --Wilcoxon 2,1 tails
|
|
149
|
-
✅ok --Mann-whitney 2,1 tails
|
|
150
|
-
✅ok --t-tests 2,1 tails
|
|
149
|
+
✅ok --Mann-whitney 2,1 tails
|
|
150
|
+
✅ok --t-tests 2,1 tails
|
|
151
151
|
|
|
152
|
-
n-sample:
|
|
152
|
+
n-sample:
|
|
153
153
|
✅ok --Kruskal-Wallis 2 tail
|
|
154
|
-
✅ok --Dunn's multiple comparisons
|
|
155
|
-
✅ok --Friedman 2 tail
|
|
156
|
-
✅ok --one-way
|
|
157
|
-
✅ok --Tukey`s multiple comparisons
|
|
154
|
+
✅ok --Dunn's multiple comparisons
|
|
155
|
+
✅ok --Friedman 2 tail
|
|
156
|
+
✅ok --one-way ANOVA 2-tailed
|
|
157
|
+
✅ok --Tukey`s multiple comparisons
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=77.0.3", "numpy", "scipy", "statsmodels", "matplotlib", "scikit-posthocs", "pandas"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -18,7 +18,8 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
18
18
|
tails=2,
|
|
19
19
|
popmean=None,
|
|
20
20
|
posthoc=False,
|
|
21
|
-
verbose=True
|
|
21
|
+
verbose=True,
|
|
22
|
+
groups_name=[]):
|
|
22
23
|
self.results = None
|
|
23
24
|
self.error = False
|
|
24
25
|
self.groups_list = groups_list
|
|
@@ -28,9 +29,27 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
28
29
|
self.posthoc = posthoc
|
|
29
30
|
self.verbose = verbose
|
|
30
31
|
self.n_groups = len(self.groups_list)
|
|
32
|
+
self.groups_name = [groups_name[i % len(groups_name)]
|
|
33
|
+
for i in range(self.n_groups)] if groups_name and groups_name != [''] else [f'Group {i+1}' for i in range(self.n_groups)]
|
|
34
|
+
|
|
31
35
|
self.warning_flag_non_numeric_data = False
|
|
32
36
|
self.summary = 'AutoStatLib v{}'.format(__version__)
|
|
33
37
|
|
|
38
|
+
# empties
|
|
39
|
+
self.results = None
|
|
40
|
+
self.error = False
|
|
41
|
+
self.warnings = []
|
|
42
|
+
self.normals = []
|
|
43
|
+
self.test_name = ''
|
|
44
|
+
self.test_id = None
|
|
45
|
+
self.test_stat = None
|
|
46
|
+
self.p_value = None
|
|
47
|
+
self.posthoc_matrix_df = None
|
|
48
|
+
self.posthoc_matrix = []
|
|
49
|
+
self.posthoc_name = ''
|
|
50
|
+
self.data = []
|
|
51
|
+
self.parametric = None
|
|
52
|
+
|
|
34
53
|
# test IDs classification:
|
|
35
54
|
self.test_ids_all = [ # in aplhabetical order
|
|
36
55
|
'anova_1w_ordinary',
|
|
@@ -80,6 +99,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
80
99
|
'no_pop_mean_set': '\nWarning: No Population Mean was set up for single-sample test, used default 0 value.\n The results might be skewed. \n Please, set the Population Mean and run the test again.\n',
|
|
81
100
|
}
|
|
82
101
|
|
|
102
|
+
|
|
83
103
|
def run_test(self, test='auto'):
|
|
84
104
|
|
|
85
105
|
# reset values from previous tests
|
|
@@ -108,7 +128,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
108
128
|
# delete the empty cols from input
|
|
109
129
|
self.data = [col for col in self.data if any(
|
|
110
130
|
x is not None for x in col)]
|
|
111
|
-
|
|
131
|
+
|
|
112
132
|
# User input assertion block
|
|
113
133
|
try:
|
|
114
134
|
assert self.data, 'There is no input data'
|
|
@@ -116,7 +136,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
116
136
|
assert test in self.test_ids_all or test == 'auto', 'Wrong test id choosen, ensure you called correct function'
|
|
117
137
|
assert all(len(
|
|
118
138
|
group) >= 4 for group in self.data), 'Each group must contain at least four values'
|
|
119
|
-
assert not (self.paired
|
|
139
|
+
assert not (self.paired is True
|
|
120
140
|
and not all(len(lst) == len(self.data[0]) for lst in self.data)), 'Paired groups must have the same length'
|
|
121
141
|
assert not (test in self.test_ids_dependent
|
|
122
142
|
and not all(len(lst) == len(self.data[0]) for lst in self.data)), 'Groups must have the same length for dependent groups test'
|
|
@@ -153,7 +173,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
153
173
|
'+' if x is True else '-' if x is False else ' ' if x is None else 'e' for x in poll)
|
|
154
174
|
self.normals.append(isnormal)
|
|
155
175
|
self.log(
|
|
156
|
-
f'
|
|
176
|
+
f' {self.groups_name[i].ljust(7, ' ')[:7]}: {poll_print[0]} {poll_print[1]} {poll_print[2]} {poll_print[3]} so disrtibution seems {"normal" if isnormal else "not normal"}')
|
|
157
177
|
self.parametric = all(self.normals)
|
|
158
178
|
|
|
159
179
|
# print test choosen
|
|
@@ -164,9 +184,9 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
164
184
|
self.log('Test chosen by user: ', test)
|
|
165
185
|
|
|
166
186
|
# Wrong test Warnings
|
|
167
|
-
if
|
|
187
|
+
if test != 'auto' and not self.parametric and test in self.test_ids_parametric:
|
|
168
188
|
self.AddWarning('param_test_with_non-normal_data')
|
|
169
|
-
if
|
|
189
|
+
if test != 'auto' and self.parametric and test not in self.test_ids_parametric:
|
|
170
190
|
self.AddWarning('non-param_test_with_normal_data')
|
|
171
191
|
|
|
172
192
|
# run the test
|
|
@@ -184,7 +204,7 @@ class StatisticalAnalysis(StatisticalTests, NormalityTests, TextFormatting, Help
|
|
|
184
204
|
self.log('-'*67 + '\n')
|
|
185
205
|
|
|
186
206
|
# print the results to console:
|
|
187
|
-
if self.verbose
|
|
207
|
+
if self.verbose is True:
|
|
188
208
|
print(self.summary)
|
|
189
209
|
|
|
190
210
|
# public methods:
|
|
@@ -82,7 +82,7 @@ class BaseStatPlot(Helpers):
|
|
|
82
82
|
x_label='',
|
|
83
83
|
y_label='',
|
|
84
84
|
print_x_labels=True,
|
|
85
|
-
|
|
85
|
+
Groups_Name=None,
|
|
86
86
|
Posthoc_Matrix=[],
|
|
87
87
|
Posthoc_Tests_Name='',
|
|
88
88
|
colormap=None,
|
|
@@ -125,7 +125,7 @@ class BaseStatPlot(Helpers):
|
|
|
125
125
|
self.p_printed = self.make_p_value_printed(self.p)
|
|
126
126
|
self.stars_printed = self.make_stars_printed(self.make_stars(self.p))
|
|
127
127
|
|
|
128
|
-
self.
|
|
128
|
+
self.groups_name = Groups_Name if Groups_Name is not None else [
|
|
129
129
|
'']
|
|
130
130
|
|
|
131
131
|
if colormap is not None and colormap != ['']:
|
|
@@ -168,9 +168,9 @@ class BaseStatPlot(Helpers):
|
|
|
168
168
|
linewidth=2,
|
|
169
169
|
widths=0.85,
|
|
170
170
|
vert=True,
|
|
171
|
-
showmeans=
|
|
172
|
-
showmedians=
|
|
173
|
-
showextrema=
|
|
171
|
+
showmeans=False,
|
|
172
|
+
showmedians=False,
|
|
173
|
+
showextrema=False,
|
|
174
174
|
points=200,
|
|
175
175
|
bw_method=0.5):
|
|
176
176
|
|
|
@@ -361,7 +361,7 @@ class BaseStatPlot(Helpers):
|
|
|
361
361
|
zorder=zorder-1)
|
|
362
362
|
|
|
363
363
|
def add_swarm(self, ax,
|
|
364
|
-
color='
|
|
364
|
+
color='dimgrey',
|
|
365
365
|
alpha=1,
|
|
366
366
|
marker='o',
|
|
367
367
|
markersize=8,
|
|
@@ -408,12 +408,12 @@ class BaseStatPlot(Helpers):
|
|
|
408
408
|
for i, data in enumerate(self.transpose(self.data_groups)):
|
|
409
409
|
ax.plot(range(len(data)), data,
|
|
410
410
|
color=color,
|
|
411
|
-
alpha=alpha * 0.
|
|
411
|
+
alpha=alpha * 0.25,
|
|
412
412
|
linewidth=linewidth * self.figure_scale_factor,
|
|
413
413
|
zorder=zorder - 1)
|
|
414
414
|
|
|
415
415
|
def add_errorbar_sd(self, ax, x,
|
|
416
|
-
capsize=
|
|
416
|
+
capsize=4,
|
|
417
417
|
ecolor='r',
|
|
418
418
|
linewidth=2,
|
|
419
419
|
zorder=3):
|
|
@@ -424,10 +424,12 @@ class BaseStatPlot(Helpers):
|
|
|
424
424
|
capsize=capsize*self.figure_scale_factor,
|
|
425
425
|
ecolor=ecolor,
|
|
426
426
|
linewidth=linewidth*self.figure_scale_factor,
|
|
427
|
+
elinewidth=linewidth*self.figure_scale_factor,
|
|
428
|
+
capthick=linewidth*self.figure_scale_factor,
|
|
427
429
|
zorder=zorder)
|
|
428
430
|
|
|
429
431
|
def add_errorbar_sem(self, ax, x,
|
|
430
|
-
capsize=
|
|
432
|
+
capsize=4,
|
|
431
433
|
ecolor='r',
|
|
432
434
|
linewidth=2,
|
|
433
435
|
zorder=3):
|
|
@@ -439,35 +441,40 @@ class BaseStatPlot(Helpers):
|
|
|
439
441
|
ecolor=ecolor,
|
|
440
442
|
linewidth=linewidth*self.figure_scale_factor,
|
|
441
443
|
elinewidth=linewidth*self.figure_scale_factor,
|
|
444
|
+
capthick=linewidth*self.figure_scale_factor,
|
|
442
445
|
zorder=zorder)
|
|
443
446
|
|
|
444
447
|
def add_mean_marker(self, ax, x,
|
|
445
448
|
marker='_',
|
|
446
449
|
markerfacecolor='#00000000',
|
|
447
450
|
markeredgecolor='r',
|
|
448
|
-
markersize=
|
|
449
|
-
|
|
451
|
+
markersize=20,
|
|
452
|
+
linewidth=2,
|
|
453
|
+
zorder=3):
|
|
450
454
|
# Overlay mean marker
|
|
451
455
|
ax.plot(x, self.mean[x],
|
|
452
456
|
marker=marker,
|
|
453
457
|
markerfacecolor=markerfacecolor,
|
|
454
458
|
markeredgecolor=markeredgecolor,
|
|
455
459
|
markersize=markersize*self.figure_scale_factor,
|
|
456
|
-
markeredgewidth=
|
|
460
|
+
markeredgewidth=linewidth*self.figure_scale_factor,
|
|
461
|
+
zorder=zorder)
|
|
457
462
|
|
|
458
463
|
def add_median_marker(self, ax, x,
|
|
459
|
-
marker='
|
|
460
|
-
markerfacecolor=
|
|
464
|
+
marker='o',
|
|
465
|
+
markerfacecolor="#FFFFFFFF",
|
|
461
466
|
markeredgecolor='r',
|
|
462
|
-
markersize=
|
|
463
|
-
|
|
467
|
+
markersize=6,
|
|
468
|
+
linewidth=2,
|
|
469
|
+
zorder=4):
|
|
464
470
|
# Overlay median marker
|
|
465
471
|
ax.plot(x, self.median[x],
|
|
466
472
|
marker=marker,
|
|
467
473
|
markerfacecolor=markerfacecolor,
|
|
468
474
|
markeredgecolor=markeredgecolor,
|
|
469
475
|
markersize=markersize*self.figure_scale_factor,
|
|
470
|
-
markeredgewidth=
|
|
476
|
+
markeredgewidth=linewidth*self.figure_scale_factor,
|
|
477
|
+
zorder=zorder)
|
|
471
478
|
|
|
472
479
|
def add_significance_bars(self, ax,
|
|
473
480
|
linewidth=2,
|
|
@@ -569,10 +576,10 @@ class BaseStatPlot(Helpers):
|
|
|
569
576
|
# Set x ticks and labels
|
|
570
577
|
if self.print_x_labels:
|
|
571
578
|
plt.subplots_adjust(bottom=0.11)
|
|
572
|
-
if self.
|
|
579
|
+
if self.groups_name != ['']:
|
|
573
580
|
ax.set_xticks(range(self.n_groups))
|
|
574
|
-
ax.set_xticklabels([self.
|
|
575
|
-
for i in range(self.n_groups)])
|
|
581
|
+
ax.set_xticklabels([self.groups_name[i % len(self.groups_name)]
|
|
582
|
+
for i in range(self.n_groups)], fontweight='regular', fontsize=8*self.figure_scale_factor)
|
|
576
583
|
else:
|
|
577
584
|
ax.set_xticks(range(self.n_groups))
|
|
578
585
|
ax.set_xticklabels(['Group {}'.format(i + 1)
|
|
@@ -628,19 +635,18 @@ class BaseStatPlot(Helpers):
|
|
|
628
635
|
|
|
629
636
|
class BarStatPlot(BaseStatPlot):
|
|
630
637
|
|
|
631
|
-
def plot(self):
|
|
638
|
+
def plot(self, linewidth=1.8):
|
|
632
639
|
fig, ax = self.setup_figure()
|
|
633
|
-
|
|
634
|
-
|
|
640
|
+
|
|
635
641
|
for x in range(len(self.data_groups)):
|
|
636
642
|
|
|
637
643
|
# Create a bar for given group.
|
|
638
|
-
self.add_barplot(ax, x)
|
|
644
|
+
self.add_barplot(ax, x, linewidth=linewidth)
|
|
639
645
|
|
|
640
646
|
# Overlay errbars, and markers.
|
|
641
|
-
self.add_median_marker(ax, x)
|
|
642
|
-
self.add_mean_marker(ax, x)
|
|
643
|
-
self.add_errorbar_sd(ax, x)
|
|
647
|
+
self.add_median_marker(ax, x, linewidth=linewidth)
|
|
648
|
+
self.add_mean_marker(ax, x, linewidth=linewidth)
|
|
649
|
+
self.add_errorbar_sd(ax, x, linewidth=linewidth)
|
|
644
650
|
|
|
645
651
|
self.add_swarm(ax)
|
|
646
652
|
self.add_significance_bars(ax, linewidth)
|
|
@@ -661,9 +667,8 @@ class ViolinStatPlot(BaseStatPlot):
|
|
|
661
667
|
https://seaborn.pydata.org/archive/0.11/generated/seaborn.violinplot.html
|
|
662
668
|
'''
|
|
663
669
|
|
|
664
|
-
def plot(self):
|
|
670
|
+
def plot(self, linewidth=1.8):
|
|
665
671
|
fig, ax = self.setup_figure()
|
|
666
|
-
linewidth = 2
|
|
667
672
|
|
|
668
673
|
for x in range(len(self.data_groups)):
|
|
669
674
|
|
|
@@ -671,9 +676,9 @@ class ViolinStatPlot(BaseStatPlot):
|
|
|
671
676
|
self.add_violinplot(ax, x)
|
|
672
677
|
|
|
673
678
|
# Overlay errbars and markers.
|
|
674
|
-
self.add_median_marker(ax, x)
|
|
675
|
-
self.add_mean_marker(ax, x)
|
|
676
|
-
|
|
679
|
+
self.add_median_marker(ax, x, linewidth=linewidth)
|
|
680
|
+
self.add_mean_marker(ax, x, linewidth=linewidth)
|
|
681
|
+
self.add_errorbar_sd(ax, x, linewidth=linewidth)
|
|
677
682
|
|
|
678
683
|
self.add_swarm(ax)
|
|
679
684
|
self.add_significance_bars(ax, linewidth)
|
|
@@ -686,9 +691,8 @@ class ViolinStatPlot(BaseStatPlot):
|
|
|
686
691
|
|
|
687
692
|
class BoxStatPlot(BaseStatPlot):
|
|
688
693
|
|
|
689
|
-
def plot(self):
|
|
694
|
+
def plot(self, linewidth=1.8):
|
|
690
695
|
fig, ax = self.setup_figure()
|
|
691
|
-
linewidth = 2
|
|
692
696
|
|
|
693
697
|
self.add_boxplot(ax)
|
|
694
698
|
self.add_swarm(ax)
|
|
@@ -699,16 +703,15 @@ class BoxStatPlot(BaseStatPlot):
|
|
|
699
703
|
|
|
700
704
|
class ScatterStatPlot(BaseStatPlot):
|
|
701
705
|
|
|
702
|
-
def plot(self):
|
|
706
|
+
def plot(self, linewidth=1.8):
|
|
703
707
|
fig, ax = self.setup_figure()
|
|
704
|
-
linewidth = 2
|
|
705
708
|
|
|
706
709
|
for x in range(len(self.data_groups)):
|
|
707
710
|
|
|
708
711
|
# Overlay errbars, and markers.
|
|
709
|
-
self.add_median_marker(ax, x)
|
|
710
|
-
self.add_mean_marker(ax, x)
|
|
711
|
-
self.add_errorbar_sd(ax, x)
|
|
712
|
+
self.add_median_marker(ax, x, linewidth=linewidth)
|
|
713
|
+
self.add_mean_marker(ax, x, linewidth=linewidth)
|
|
714
|
+
self.add_errorbar_sd(ax, x, linewidth=linewidth)
|
|
712
715
|
|
|
713
716
|
self.add_scatter(ax)
|
|
714
717
|
self.add_significance_bars(ax, linewidth)
|
|
@@ -721,16 +724,15 @@ class ScatterStatPlot(BaseStatPlot):
|
|
|
721
724
|
|
|
722
725
|
class SwarmStatPlot(BaseStatPlot):
|
|
723
726
|
|
|
724
|
-
def plot(self):
|
|
727
|
+
def plot(self, linewidth=1.8):
|
|
725
728
|
fig, ax = self.setup_figure()
|
|
726
|
-
linewidth = 2
|
|
727
729
|
|
|
728
730
|
for x in range(len(self.data_groups)):
|
|
729
731
|
|
|
730
732
|
# Overlay errbars, and markers.
|
|
731
|
-
self.add_median_marker(ax, x)
|
|
732
|
-
self.add_mean_marker(ax, x)
|
|
733
|
-
self.add_errorbar_sd(ax, x)
|
|
733
|
+
self.add_median_marker(ax, x, linewidth=linewidth)
|
|
734
|
+
self.add_mean_marker(ax, x, linewidth=linewidth)
|
|
735
|
+
self.add_errorbar_sd(ax, x, linewidth=linewidth)
|
|
734
736
|
|
|
735
737
|
self.add_swarm(ax)
|
|
736
738
|
self.add_significance_bars(ax, linewidth)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# AutoStatLib package version:
|
|
2
|
-
__version__ = "0.2.
|
|
2
|
+
__version__ = "0.2.21"
|
|
@@ -65,6 +65,7 @@ class Helpers():
|
|
|
65
65
|
'Stars': self.stars_int,
|
|
66
66
|
# 'Stat_Value': self.test_stat.item(),
|
|
67
67
|
'Warnings': self.warnings,
|
|
68
|
+
'Groups_Name': self.groups_name,
|
|
68
69
|
'Groups_N': [len(self.data[i]) for i in range(len(self.data))],
|
|
69
70
|
'Groups_Median': [np.median(self.data[i]).item() for i in range(len(self.data))],
|
|
70
71
|
'Groups_Mean': [np.mean(self.data[i]).item() for i in range(len(self.data))],
|
|
@@ -22,7 +22,7 @@ class TextFormatting():
|
|
|
22
22
|
group_longest = max(len(row) for row in data)
|
|
23
23
|
|
|
24
24
|
# Print the header
|
|
25
|
-
header =
|
|
25
|
+
header = self.groups_name
|
|
26
26
|
line = [''*7]
|
|
27
27
|
self.log(self.autospace(header, space))
|
|
28
28
|
self.log(self.autospace(line, space))
|
|
@@ -92,7 +92,7 @@ class TextFormatting():
|
|
|
92
92
|
if p is not None:
|
|
93
93
|
if p < 0.0001:
|
|
94
94
|
return 4
|
|
95
|
-
|
|
95
|
+
elif p < 0.001:
|
|
96
96
|
return 3
|
|
97
97
|
elif p < 0.01:
|
|
98
98
|
return 2
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AutoStatLib
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.21
|
|
4
4
|
Summary: AutoStatLib - a simple statistical analysis tool
|
|
5
5
|
Author: Stemonitis, SciWare LLC
|
|
6
6
|
Author-email: konung-yaropolk <yaropolk1995@gmail.com>
|
|
@@ -659,39 +659,39 @@ If errors occured, *GetResult()* returns an empty dictionary
|
|
|
659
659
|
|
|
660
660
|
---
|
|
661
661
|
|
|
662
|
-
##
|
|
662
|
+
## Alpha dev status.
|
|
663
663
|
|
|
664
664
|
### TODO:
|
|
665
665
|
|
|
666
|
-
-- Anova: posthocs
|
|
667
|
-
-- Anova: add 2-way anova and 3-way anova
|
|
668
|
-
-- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
|
|
669
|
-
-- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
|
|
670
|
-
-- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
|
|
671
|
-
-- add Welch test (for norm data unequal variances)
|
|
672
|
-
-- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
|
|
673
|
-
-- add independent t-test with Welch correction (do not assume equal SDs in groups)
|
|
674
|
-
-- add correlation test, correlation diagram
|
|
675
|
-
-- add linear regression, regression diagram
|
|
666
|
+
-- Anova: posthocs
|
|
667
|
+
-- Anova: add 2-way anova and 3-way anova
|
|
668
|
+
-- onevay Anova: add repeated measures (for normal dependent values) with and without Gaisser-Greenhouse correction
|
|
669
|
+
-- onevay Anova: add Brown-Forsithe and Welch (for normal independent values with unequal SDs between groups)
|
|
670
|
+
-- paired T-test: add ratio-paired t-test (ratios of paired values are consistent)
|
|
671
|
+
-- add Welch test (for norm data unequal variances)
|
|
672
|
+
-- add Kolmogorov-smirnov test (unpaired nonparametric 2 sample, compare cumulative distributions)
|
|
673
|
+
-- add independent t-test with Welch correction (do not assume equal SDs in groups)
|
|
674
|
+
-- add correlation test, correlation diagram
|
|
675
|
+
-- add linear regression, regression diagram
|
|
676
676
|
-- add QQ plot
|
|
677
677
|
-- n-sample tests: add onetail option
|
|
678
678
|
|
|
679
679
|
✅ done -- detailed normality test results
|
|
680
680
|
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
681
681
|
|
|
682
|
-
tests check:
|
|
683
|
-
1-sample:
|
|
682
|
+
tests check:
|
|
683
|
+
1-sample:
|
|
684
684
|
✅ok --Wilcoxon 2,1 tails
|
|
685
|
-
✅ok --t-tests 2,1 tails
|
|
685
|
+
✅ok --t-tests 2,1 tails
|
|
686
686
|
|
|
687
|
-
2-sample:
|
|
687
|
+
2-sample:
|
|
688
688
|
✅ok --Wilcoxon 2,1 tails
|
|
689
|
-
✅ok --Mann-whitney 2,1 tails
|
|
690
|
-
✅ok --t-tests 2,1 tails
|
|
689
|
+
✅ok --Mann-whitney 2,1 tails
|
|
690
|
+
✅ok --t-tests 2,1 tails
|
|
691
691
|
|
|
692
|
-
n-sample:
|
|
692
|
+
n-sample:
|
|
693
693
|
✅ok --Kruskal-Wallis 2 tail
|
|
694
|
-
✅ok --Dunn's multiple comparisons
|
|
695
|
-
✅ok --Friedman 2 tail
|
|
696
|
-
✅ok --one-way
|
|
697
|
-
✅ok --Tukey`s multiple comparisons
|
|
694
|
+
✅ok --Dunn's multiple comparisons
|
|
695
|
+
✅ok --Friedman 2 tail
|
|
696
|
+
✅ok --one-way ANOVA 2-tailed
|
|
697
|
+
✅ok --Tukey`s multiple comparisons
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|