This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
robots = rfs.loc[(rfs.Subcategory == "Robots"), "Goal"].values | |
flight = rfs.loc[(rfs.Subcategory == "Flight"), "Goal"].values | |
sound = rfs.loc[(rfs.Subcategory == "Sound"), "Goal"].values | |
log_robots = np.log(robots) | |
log_flight = np.log(flight) | |
log_sound = np.log(sound) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
print("Robots: ", normaltest(robots).pvalue) | |
print("Flight: ", normaltest(flight).pvalue) | |
print("Sound: ", normaltest(sound).pvalue) | |
print() | |
print("Log(robots): ", normaltest(log_robots).pvalue) | |
print("Log(Flight): ", normaltest(log_flight).pvalue) | |
print("Log(Sound): ", normaltest(log_sound).pvalue) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pvalues with scipy: | |
stat_results = [ | |
mannwhitneyu(robots, flight, alternative="two-sided"), | |
mannwhitneyu(flight, sound, alternative="two-sided"), | |
mannwhitneyu(robots, sound, alternative="two-sided") | |
] | |
pvalues = [result.pvalue for result in stat_results] | |
print("Robots vs Flight: \n", stat_results[0], "\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pairs = [('Robots', 'Flight'), # 'Robots' vs 'Flight' | |
('Flight', 'Sound'), # 'Flight' vs 'Sound' | |
('Robots', 'Sound')] # 'Robots' vs 'Sound' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from statannotations.Annotator import Annotator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With ... = all parameters passed to seaborn's plotter | |
annotator = Annotator(ax, box_pairs, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With ... = all parameters passed to seaborn's plotter | |
annotator = Annotator(ax, pairs, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pvalues = [ | |
sci_stats.mannwhitneyu(robots, flight, alternative="two-sided").pvalue, | |
sci_stats.mannwhitneyu(flight, sound, alternative="two-sided").pvalue, | |
sci_stats.mannwhitneyu(robots, sound, alternative="two-sided").pvalue | |
] | |
# pvalues | |
# [0.00013485140468088997, 0.2557331102364572, 0.00022985464929005115] | |
# Transform each p-value to "p=" in scientific notation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
annotator.set_custom_annotations(formatted_pvalues) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
annotator.annotate() |