How to Perform Dunn’s Test with Python
In Python, the scikit-posthocs library provides an efficient way to conduct Dunn’s Test. This article will guide you through the process of performing Dunn’s Test in Python, step by step.
Syntax to install posthocs library:
! pip install scikit-posthocs
posthoc_dunn() Function:
Syntax:
scikit_posthocs.posthoc_dunn(a, val_col: str = None, group_col: str = None, p_adjust: str = None, sort: bool = True)
Parameters:
- a : it’s an array type object or a dataframe object or series.
- group_col : column of the predictor or the dependent variable
- p_adjust: P values can be adjusted using this method. it’s a string type possible values are :
- ‘bonferroni’
- hommel
- holm-sidak
- holm
- simes-hochberg and more…
Returns: p-values.
Hypotheses:
This is a hypotheses test and the two hypotheses are as follows:
- Null hypothesis: The given sample have the same median
- Alternative hypothesis: The given sample has a different median.
How to Perform Dunn’s Test in Python
Dunn’s test is a statistical procedure used for multiple comparisons following a Kruskal-Wallis test. Here’s a breakdown of what it does and when it’s used:
Table of Content
- Dunn’s Test
- What is the Kruskal-Wallis test?
- Key points about Dunn’s test
- How to Perform Dunn’s Test with Python
- Step-by-Step Guide to Perform Dunn’s Test in Python
- Frequently Asked Questions on Dunn’s Test