AutoStatLib 0.2.14__tar.gz → 0.2.16__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.14/src/AutoStatLib.egg-info → autostatlib-0.2.16}/PKG-INFO +21 -20
- {autostatlib-0.2.14 → autostatlib-0.2.16}/README.md +19 -19
- {autostatlib-0.2.14 → autostatlib-0.2.16}/requirements.txt +1 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/StatPlots.py +106 -28
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/_version.py +1 -1
- {autostatlib-0.2.14 → autostatlib-0.2.16/src/AutoStatLib.egg-info}/PKG-INFO +21 -20
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib.egg-info/requires.txt +1 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/LICENSE +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/MANIFEST.in +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/pyproject.toml +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/setup.cfg +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/AutoStatLib.py +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/__init__.py +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/__main__.py +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/helpers.py +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/normality_tests.py +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/statistical_tests.py +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib/text_formatting.py +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib.egg-info/SOURCES.txt +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/src/AutoStatLib.egg-info/dependency_links.txt +0 -0
- {autostatlib-0.2.14 → autostatlib-0.2.16}/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.16
|
|
4
4
|
Summary: AutoStatLib - a simple statistical analysis tool
|
|
5
5
|
Author: Stemonitis, SciWare LLC
|
|
6
6
|
Author-email: konung-yaropolk <yaropolk1995@gmail.com>
|
|
@@ -533,6 +533,7 @@ Requires-Dist: numpy
|
|
|
533
533
|
Requires-Dist: scipy
|
|
534
534
|
Requires-Dist: statsmodels
|
|
535
535
|
Requires-Dist: matplotlib
|
|
536
|
+
Requires-Dist: seaborn
|
|
536
537
|
Requires-Dist: scikit-posthocs
|
|
537
538
|
Requires-Dist: pandas
|
|
538
539
|
Dynamic: license-file
|
|
@@ -675,22 +676,22 @@ If errors occured, *GetResult()* returns an empty dictionary
|
|
|
675
676
|
-- add QQ plot
|
|
676
677
|
-- n-sample tests: add onetail option
|
|
677
678
|
|
|
678
|
-
✅ done -- detailed normality test results
|
|
679
|
-
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
680
|
-
|
|
681
|
-
tests check:
|
|
682
|
-
1-sample:
|
|
683
|
-
--Wilcoxon 2,1 tails - ✅ok
|
|
684
|
-
--t-tests 2,1 tails -✅ok
|
|
685
|
-
|
|
686
|
-
2-sample:
|
|
687
|
-
--Wilcoxon 2,1 tails - ✅ok
|
|
688
|
-
--Mann-whitney 2,1 tails - ✅ok
|
|
689
|
-
--t-tests 2,1 tails -✅ok
|
|
690
|
-
|
|
691
|
-
n-sample:
|
|
692
|
-
--Kruskal-Wallis 2 tail - ✅ok
|
|
693
|
-
--Dunn's multiple comparisons - ✅ok
|
|
694
|
-
--Friedman 2 tail - ✅ok
|
|
695
|
-
--one-way ANOWA 2 tail - ✅ok
|
|
696
|
-
--Tukey`s multiple comparisons - ✅ok
|
|
679
|
+
✅ done -- detailed normality test results
|
|
680
|
+
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
681
|
+
|
|
682
|
+
tests check:
|
|
683
|
+
1-sample:
|
|
684
|
+
--Wilcoxon 2,1 tails - ✅ok
|
|
685
|
+
--t-tests 2,1 tails -✅ok
|
|
686
|
+
|
|
687
|
+
2-sample:
|
|
688
|
+
--Wilcoxon 2,1 tails - ✅ok
|
|
689
|
+
--Mann-whitney 2,1 tails - ✅ok
|
|
690
|
+
--t-tests 2,1 tails -✅ok
|
|
691
|
+
|
|
692
|
+
n-sample:
|
|
693
|
+
--Kruskal-Wallis 2 tail - ✅ok
|
|
694
|
+
--Dunn's multiple comparisons - ✅ok
|
|
695
|
+
--Friedman 2 tail - ✅ok
|
|
696
|
+
--one-way ANOWA 2 tail - ✅ok
|
|
697
|
+
--Tukey`s multiple comparisons - ✅ok
|
|
@@ -136,22 +136,22 @@ If errors occured, *GetResult()* returns an empty dictionary
|
|
|
136
136
|
-- add QQ plot
|
|
137
137
|
-- n-sample tests: add onetail option
|
|
138
138
|
|
|
139
|
-
✅ done -- detailed normality test results
|
|
140
|
-
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
141
|
-
|
|
142
|
-
tests check:
|
|
143
|
-
1-sample:
|
|
144
|
-
--Wilcoxon 2,1 tails - ✅ok
|
|
145
|
-
--t-tests 2,1 tails -✅ok
|
|
146
|
-
|
|
147
|
-
2-sample:
|
|
148
|
-
--Wilcoxon 2,1 tails - ✅ok
|
|
149
|
-
--Mann-whitney 2,1 tails - ✅ok
|
|
150
|
-
--t-tests 2,1 tails -✅ok
|
|
151
|
-
|
|
152
|
-
n-sample:
|
|
153
|
-
--Kruskal-Wallis 2 tail - ✅ok
|
|
154
|
-
--Dunn's multiple comparisons - ✅ok
|
|
155
|
-
--Friedman 2 tail - ✅ok
|
|
156
|
-
--one-way ANOWA 2 tail - ✅ok
|
|
157
|
-
--Tukey`s multiple comparisons - ✅ok
|
|
139
|
+
✅ done -- detailed normality test results
|
|
140
|
+
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
141
|
+
|
|
142
|
+
tests check:
|
|
143
|
+
1-sample:
|
|
144
|
+
--Wilcoxon 2,1 tails - ✅ok
|
|
145
|
+
--t-tests 2,1 tails -✅ok
|
|
146
|
+
|
|
147
|
+
2-sample:
|
|
148
|
+
--Wilcoxon 2,1 tails - ✅ok
|
|
149
|
+
--Mann-whitney 2,1 tails - ✅ok
|
|
150
|
+
--t-tests 2,1 tails -✅ok
|
|
151
|
+
|
|
152
|
+
n-sample:
|
|
153
|
+
--Kruskal-Wallis 2 tail - ✅ok
|
|
154
|
+
--Dunn's multiple comparisons - ✅ok
|
|
155
|
+
--Friedman 2 tail - ✅ok
|
|
156
|
+
--one-way ANOWA 2 tail - ✅ok
|
|
157
|
+
--Tukey`s multiple comparisons - ✅ok
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import seaborn as sns
|
|
1
2
|
import random
|
|
2
3
|
# from math import comb
|
|
3
4
|
import numpy as np
|
|
@@ -149,31 +150,6 @@ class BaseStatPlot(Helpers):
|
|
|
149
150
|
|
|
150
151
|
return fig, ax
|
|
151
152
|
|
|
152
|
-
def add_scatter(self, ax,
|
|
153
|
-
color='k',
|
|
154
|
-
alpha=0.5,
|
|
155
|
-
marker='o',
|
|
156
|
-
markersize=6,
|
|
157
|
-
linewidth=1,
|
|
158
|
-
zorder=1):
|
|
159
|
-
# Generate x jitter pool.
|
|
160
|
-
spread_pool = [] # storing x positions of data points
|
|
161
|
-
for i, data in enumerate(self.data_groups):
|
|
162
|
-
spread = tuple(random.uniform(-.10, .10) for _ in data)
|
|
163
|
-
spread_pool.append(tuple(i + s for s in spread))
|
|
164
|
-
|
|
165
|
-
for i, data in enumerate(self.transpose(self.data_groups)):
|
|
166
|
-
# Plot individual data points with x jitter.
|
|
167
|
-
ax.plot(self.transpose(spread_pool)[i], data,
|
|
168
|
-
color=color,
|
|
169
|
-
alpha=alpha,
|
|
170
|
-
marker=marker,
|
|
171
|
-
markersize=markersize*self.figure_scale_factor,
|
|
172
|
-
linewidth=linewidth*self.figure_scale_factor,
|
|
173
|
-
# Connect the data points if desired.
|
|
174
|
-
linestyle='-' if self.dependent else '',
|
|
175
|
-
zorder=zorder)
|
|
176
|
-
|
|
177
153
|
def add_barplot(self, ax, x,
|
|
178
154
|
fill=True,
|
|
179
155
|
linewidth=2,
|
|
@@ -359,6 +335,83 @@ class BaseStatPlot(Helpers):
|
|
|
359
335
|
patch.set_facecolor(
|
|
360
336
|
self.colors_fill[x % len(self.colors_fill)])
|
|
361
337
|
|
|
338
|
+
def add_scatter(self, ax,
|
|
339
|
+
color='k',
|
|
340
|
+
alpha=0.5,
|
|
341
|
+
marker='o',
|
|
342
|
+
markersize=8,
|
|
343
|
+
linewidth=1.2,
|
|
344
|
+
zorder=1):
|
|
345
|
+
# Generate x jitter pool.
|
|
346
|
+
spread_pool = [] # storing x positions of data points
|
|
347
|
+
for i, data in enumerate(self.data_groups):
|
|
348
|
+
spread = tuple(random.uniform(-.10, .10) for _ in data)
|
|
349
|
+
spread_pool.append(tuple(i + s for s in spread))
|
|
350
|
+
|
|
351
|
+
for i, data in enumerate(self.transpose(self.data_groups)):
|
|
352
|
+
# Plot individual data points with x jitter.
|
|
353
|
+
ax.plot(self.transpose(spread_pool)[i], data,
|
|
354
|
+
color=color,
|
|
355
|
+
alpha=alpha,
|
|
356
|
+
marker=marker,
|
|
357
|
+
markersize=markersize*self.figure_scale_factor,
|
|
358
|
+
linewidth=linewidth*self.figure_scale_factor,
|
|
359
|
+
# Connect the data points if desired.
|
|
360
|
+
linestyle='-' if self.dependent else '',
|
|
361
|
+
zorder=zorder)
|
|
362
|
+
|
|
363
|
+
def add_swarm(self, ax,
|
|
364
|
+
color='grey',
|
|
365
|
+
alpha=1,
|
|
366
|
+
marker='o',
|
|
367
|
+
markersize=8,
|
|
368
|
+
linewidth=1.4,
|
|
369
|
+
zorder=1):
|
|
370
|
+
"""
|
|
371
|
+
Add a swarmplot (scatter-like plot with non-overlapping points)
|
|
372
|
+
to the provided Axes. Automatically reduce point size if overcrowded.
|
|
373
|
+
"""
|
|
374
|
+
|
|
375
|
+
# Prepare flattened data
|
|
376
|
+
values = [v for i, group in enumerate(self.data_groups) for v in group]
|
|
377
|
+
groups = [i for i, group in enumerate(self.data_groups) for _ in group]
|
|
378
|
+
|
|
379
|
+
# Estimate overcrowding for adaptive sizing
|
|
380
|
+
group_counts = [len(g) for g in self.data_groups]
|
|
381
|
+
max_points = max(group_counts) if group_counts else 1
|
|
382
|
+
|
|
383
|
+
# Determine horizontal space per category
|
|
384
|
+
num_groups = len(self.data_groups)
|
|
385
|
+
xlim = ax.get_xlim()
|
|
386
|
+
width_per_group = (xlim[1] - xlim[0]) / max(num_groups, 1)
|
|
387
|
+
|
|
388
|
+
# Empirical density threshold: if points are too dense, shrink
|
|
389
|
+
density = max_points / (width_per_group + 1e-6)
|
|
390
|
+
|
|
391
|
+
# Tunable constants to approximate best function of size adjustment
|
|
392
|
+
size_scale = max(0.1, min(1, 3.5 / (density ** 0.5)))
|
|
393
|
+
|
|
394
|
+
sns.swarmplot(
|
|
395
|
+
x=groups,
|
|
396
|
+
y=values,
|
|
397
|
+
ax=ax,
|
|
398
|
+
color=color,
|
|
399
|
+
alpha=alpha,
|
|
400
|
+
size=markersize * self.figure_scale_factor * size_scale,
|
|
401
|
+
marker=marker,
|
|
402
|
+
linewidth=linewidth * self.figure_scale_factor * size_scale,
|
|
403
|
+
zorder=zorder,
|
|
404
|
+
)
|
|
405
|
+
|
|
406
|
+
# Connect points if data paired
|
|
407
|
+
if self.dependent == True:
|
|
408
|
+
for i, data in enumerate(self.transpose(self.data_groups)):
|
|
409
|
+
ax.plot(range(len(data)), data,
|
|
410
|
+
color=color,
|
|
411
|
+
alpha=alpha * 0.7,
|
|
412
|
+
linewidth=linewidth * self.figure_scale_factor,
|
|
413
|
+
zorder=zorder - 1)
|
|
414
|
+
|
|
362
415
|
def add_errorbar_sd(self, ax, x,
|
|
363
416
|
capsize=8,
|
|
364
417
|
ecolor='r',
|
|
@@ -589,7 +642,7 @@ class BarStatPlot(BaseStatPlot):
|
|
|
589
642
|
self.add_mean_marker(ax, x)
|
|
590
643
|
self.add_errorbar_sd(ax, x)
|
|
591
644
|
|
|
592
|
-
self.
|
|
645
|
+
self.add_swarm(ax)
|
|
593
646
|
self.add_significance_bars(ax, linewidth)
|
|
594
647
|
self.add_titles_and_labels(fig, ax)
|
|
595
648
|
self.axes_formatting(ax, linewidth)
|
|
@@ -622,7 +675,7 @@ class ViolinStatPlot(BaseStatPlot):
|
|
|
622
675
|
self.add_mean_marker(ax, x)
|
|
623
676
|
# self.add_errorbar_sd(ax, x)
|
|
624
677
|
|
|
625
|
-
self.
|
|
678
|
+
self.add_swarm(ax)
|
|
626
679
|
self.add_significance_bars(ax, linewidth)
|
|
627
680
|
self.add_titles_and_labels(fig, ax)
|
|
628
681
|
self.axes_formatting(ax, linewidth)
|
|
@@ -635,7 +688,7 @@ class BoxStatPlot(BaseStatPlot):
|
|
|
635
688
|
linewidth = 2
|
|
636
689
|
|
|
637
690
|
self.add_boxplot(ax)
|
|
638
|
-
self.
|
|
691
|
+
self.add_swarm(ax)
|
|
639
692
|
self.add_significance_bars(ax, linewidth)
|
|
640
693
|
self.add_titles_and_labels(fig, ax)
|
|
641
694
|
self.axes_formatting(ax, linewidth)
|
|
@@ -658,3 +711,28 @@ class ScatterStatPlot(BaseStatPlot):
|
|
|
658
711
|
self.add_significance_bars(ax, linewidth)
|
|
659
712
|
self.add_titles_and_labels(fig, ax)
|
|
660
713
|
self.axes_formatting(ax, linewidth)
|
|
714
|
+
|
|
715
|
+
xmin, xmax = ax.get_xlim()
|
|
716
|
+
ax.set_xlim(xmin - 0.25, xmax + 0.25)
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
class SwarmStatPlot(BaseStatPlot):
|
|
720
|
+
|
|
721
|
+
def plot(self):
|
|
722
|
+
fig, ax = self.setup_figure()
|
|
723
|
+
linewidth = 2
|
|
724
|
+
|
|
725
|
+
for x in range(len(self.data_groups)):
|
|
726
|
+
|
|
727
|
+
# Overlay errbars, and markers.
|
|
728
|
+
self.add_median_marker(ax, x)
|
|
729
|
+
self.add_mean_marker(ax, x)
|
|
730
|
+
self.add_errorbar_sd(ax, x)
|
|
731
|
+
|
|
732
|
+
self.add_swarm(ax)
|
|
733
|
+
self.add_significance_bars(ax, linewidth)
|
|
734
|
+
self.add_titles_and_labels(fig, ax)
|
|
735
|
+
self.axes_formatting(ax, linewidth)
|
|
736
|
+
|
|
737
|
+
xmin, xmax = ax.get_xlim()
|
|
738
|
+
ax.set_xlim(xmin - 0.25, xmax + 0.25)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# AutoStatLib package version:
|
|
2
|
-
__version__ = "0.2.
|
|
2
|
+
__version__ = "0.2.16"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AutoStatLib
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.16
|
|
4
4
|
Summary: AutoStatLib - a simple statistical analysis tool
|
|
5
5
|
Author: Stemonitis, SciWare LLC
|
|
6
6
|
Author-email: konung-yaropolk <yaropolk1995@gmail.com>
|
|
@@ -533,6 +533,7 @@ Requires-Dist: numpy
|
|
|
533
533
|
Requires-Dist: scipy
|
|
534
534
|
Requires-Dist: statsmodels
|
|
535
535
|
Requires-Dist: matplotlib
|
|
536
|
+
Requires-Dist: seaborn
|
|
536
537
|
Requires-Dist: scikit-posthocs
|
|
537
538
|
Requires-Dist: pandas
|
|
538
539
|
Dynamic: license-file
|
|
@@ -675,22 +676,22 @@ If errors occured, *GetResult()* returns an empty dictionary
|
|
|
675
676
|
-- add QQ plot
|
|
676
677
|
-- n-sample tests: add onetail option
|
|
677
678
|
|
|
678
|
-
✅ done -- detailed normality test results
|
|
679
|
-
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
680
|
-
|
|
681
|
-
tests check:
|
|
682
|
-
1-sample:
|
|
683
|
-
--Wilcoxon 2,1 tails - ✅ok
|
|
684
|
-
--t-tests 2,1 tails -✅ok
|
|
685
|
-
|
|
686
|
-
2-sample:
|
|
687
|
-
--Wilcoxon 2,1 tails - ✅ok
|
|
688
|
-
--Mann-whitney 2,1 tails - ✅ok
|
|
689
|
-
--t-tests 2,1 tails -✅ok
|
|
690
|
-
|
|
691
|
-
n-sample:
|
|
692
|
-
--Kruskal-Wallis 2 tail - ✅ok
|
|
693
|
-
--Dunn's multiple comparisons - ✅ok
|
|
694
|
-
--Friedman 2 tail - ✅ok
|
|
695
|
-
--one-way ANOWA 2 tail - ✅ok
|
|
696
|
-
--Tukey`s multiple comparisons - ✅ok
|
|
679
|
+
✅ done -- detailed normality test results
|
|
680
|
+
✅ done -- added posthoc: Kruskal-Wallis Dunn's multiple comparisons
|
|
681
|
+
|
|
682
|
+
tests check:
|
|
683
|
+
1-sample:
|
|
684
|
+
--Wilcoxon 2,1 tails - ✅ok
|
|
685
|
+
--t-tests 2,1 tails -✅ok
|
|
686
|
+
|
|
687
|
+
2-sample:
|
|
688
|
+
--Wilcoxon 2,1 tails - ✅ok
|
|
689
|
+
--Mann-whitney 2,1 tails - ✅ok
|
|
690
|
+
--t-tests 2,1 tails -✅ok
|
|
691
|
+
|
|
692
|
+
n-sample:
|
|
693
|
+
--Kruskal-Wallis 2 tail - ✅ok
|
|
694
|
+
--Dunn's multiple comparisons - ✅ok
|
|
695
|
+
--Friedman 2 tail - ✅ok
|
|
696
|
+
--one-way ANOWA 2 tail - ✅ok
|
|
697
|
+
--Tukey`s multiple comparisons - ✅ok
|
|
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
|
|
File without changes
|
|
File without changes
|