elena1234

Post-Hoc test in Python

Jul 22nd, 2022 (edited)
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. # Tukey HSD test
  2. # assumptions: equal variances between groups and equal group size
  3. from statsmodels.stats.multicomp import pairwise_tukeyhsd
  4. from statsmodels.stats.multicomp import MultiComparison
  5. mc = MultiComparison(data["value"], data["treatments"])
  6. mcresult = mc.tukeyhsd(0.05)
  7. mcresult.summary()
  8.  
  9.  
  10. # After ANOVA if group size is different, we use Tukey-Kramer Post-Hoc test
  11. # If we have Control group and want only these comparisson -> C:A, C:B, C:D, then the appropriate test is Dunnett's Post-Hoc test
  12. # After Welch's ANOVA -> Games-Howell Post-Hoc test, because variances are not equal
  13. # After Friedman we use Wilcoxon Post-Hoc test
  14. # After Kruskal-Wallis we use Dunn Post-Hoc test or Nemenyi Post-Hoc test
Add Comment
Please, Sign In to add comment