Skip to content
This repository was archived by the owner on Aug 1, 2022. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion statannot/statannot.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ def stat_test(
):
"""Get formatted result of two sample statistical test.

EDIT 16.11.2020 - Veronika Brumovska
- implementing ANOVA (line 84)
Comment on lines +30 to +31

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this was ever done in this repo, but it would be great to be logged.
I wouldn't put that here though. Maybe we could suggest a changelog or acknowledgement file dedicated to contributions ?


Arguments
---------
bbox_data1, bbox_data2
Expand Down Expand Up @@ -78,6 +81,17 @@ def stat_test(
u_stat,
pval,
)
elif test == 'anova':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most tests (not t-test_something) are capitalized, so I'd suggest Anova for consistency

u_stat, pval = stats.f_oneway(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity in the code, and accurate reporting below, I'd change u_stat to f_stat.

box_data1, box_data2, **stats_params
)
result = StatResult(
'anova',
'anova',
'U_stat',
u_stat,
pval,
)
elif test == 'Mann-Whitney-gt':
u_stat, pval = stats.mannwhitneyu(
box_data1, box_data2, alternative='greater', **stats_params
Expand Down Expand Up @@ -365,7 +379,7 @@ def get_box_data(box_plotter, boxName):
"or `test_short_name` must be `None`.")
valid_list = ['t-test_ind', 't-test_welch', 't-test_paired',
'Mann-Whitney', 'Mann-Whitney-gt', 'Mann-Whitney-ls',
'Levene', 'Wilcoxon', 'Kruskal']
'Levene', 'Wilcoxon', 'Kruskal', "anova"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

if test not in valid_list:
raise ValueError("test value should be one of the following: {}."
.format(', '.join(valid_list)))
Expand Down