Hosted by CoCalc
Download
Kernel: Python 3 (Ubuntu Linux)

scikit-posthocs

Pairwise Multiple Comparisons Post-hoc Tests

in Python 3 (Ubuntu Linux)

https://github.com/maximtrp/scikit-posthocs

import scikit_posthocs as sp x = [[1,2,3,5,1], [12,31,54], [10,12,6,74,11]] sp.posthoc_conover(x, p_adjust = 'holm')
array([[-1. , 0.00119517, 0.00278329], [ 0.00119517, -1. , 0.18672227], [ 0.00278329, 0.18672227, -1. ]])
import scikit_posthocs as sp import pandas as pd x = pd.DataFrame({"a": [1,2,3,5,1], "b": [12,31,54,62,12], "c": [10,12,6,74,11]}) x = x.melt(var_name='groups', value_name='values') x
sp.posthoc_conover(x, val_col='values', group_col='groups')
pc = sp.posthoc_conover(x, val_col='values', group_col='groups') heatmap_args = {'linewidths': 0.25, 'linecolor': '0.5', 'clip_on': False, 'square': True, 'cbar_ax_bbox': [0.80, 0.35, 0.04, 0.3]} sp.sign_plot(pc, **heatmap_args)
(<matplotlib.axes._subplots.AxesSubplot at 0x7f67b595ffd0>, <matplotlib.colorbar.ColorbarBase at 0x7f67b160c128>)
Image in a Jupyter notebook
pc = sp.posthoc_conover(x, val_col='values', group_col='groups') # Format: diagonal, non-significant, p<0.001, p<0.01, p<0.05 cmap = ['1', '#fb6a4a', '#08306b', '#4292c6', '#c6dbef'] heatmap_args = {'cmap': cmap, 'linewidths': 0.25, 'linecolor': '0.5', 'clip_on': False, 'square': True, 'cbar_ax_bbox': [0.80, 0.35, 0.04, 0.3]} sp.sign_plot(pc, **heatmap_args)
(<matplotlib.axes._subplots.AxesSubplot at 0x7f67b1636e10>, <matplotlib.colorbar.ColorbarBase at 0x7f67b15efd68>)
Image in a Jupyter notebook