> For the complete documentation index, see [llms.txt](https://help.connected.illumina.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.connected.illumina.com/icm/analyses/analysis-functionality/task-menu/statistics/differential-analysis/kruskal-wallis-1.md).

# Kruskal-Wallis / Wilcoxon

Both Kruskal-Wallis and Wilcoxon tests are rank tests, such rank-based tests are generally advised for use with larger sample sizes. They both can only take one factor into account at a time. Kruskal-Wallis can perform on an attribute with two or more subgroups.

Wilcoxon test is a close alternative to Kruskal-wallis task, match the results of [scany Wilcoxon method](https://scanpy.readthedocs.io/en/stable/generated/scanpy.tl.rank_genes_groups.html). This test is also called "Wilcoxon Rank-Sum Test" or "Mann-Whitney U Test". When you perform comparisons on the two groups, it will filter only include the two groups first and then perform the differential analysis.

## Running the task

To invoke the Kruskal-Wallis test, select any count-based data nodes, these include:

* Gene counts
* Transcript counts
* Normalized counts

After clicking on the chosen node:

* Select *Statistics > Differential analysis* in the context-sensitive menu.
* Select *Kruskal-Wallis or Wilcoxon.*
* Select a specific factor for analysis and click the **Next** button to setup the comparisons.

<figure><img src="/files/I5HTFSFxMkmdBZbwlmFm" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note**: Wilcoxon test will filter the data to include the observations in the two comparison groups to generate p-value, while Kruskal-Wallis will use all the samples in the input data to generate p-value on the selected attribute.
{% endhint %}

* Define the comparisons by dragging and dropping each group in the *Denominator* and *Numerator* boxes and click **Add comparison**

<div align="left"><figure><img src="/files/VbPmoI3MYDPJrxlBXbS4" alt=""><figcaption></figcaption></figure></div>

If the data has not been filtered upstream the **Low value filter** box will be checked by default. Similarly, the **Default** normalisation will be selected if the software detects that the data as not been previously normalised.

<figure><img src="/files/2fonAywqsHlkKUOQNL9g" alt=""><figcaption></figcaption></figure>

## Advanced option

If there are tied ranks of feature expression values, the default is not use tie correction which is corresponding to the scanpy.tl.rank\_genes\_groups(tie\_correct = False).

<div align="left"><figure><img src="/files/K4EKQDSahYvIT8yw0zdF" alt=""><figcaption></figcaption></figure></div>

The results of the analysis will appear similar to other [ANOVA/LIMMA-trend/LIMMA-voom](/icm/analyses/analysis-functionality/task-menu/statistics/differential-analysis/anova-limma-trend-limma-voom.md). However, the column to indicate mean expression levels for each group will display the median instead for Kruskal-Wallis.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.connected.illumina.com/icm/analyses/analysis-functionality/task-menu/statistics/differential-analysis/kruskal-wallis-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
