> 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/batch-removal/general-linear-model.md).

# General linear model

This method is based on general linear model, much like ANOVA\[1] in reverse, it calculates the variation attributed to the factor(s) being removed then adjusting the original values to remove the variation.

By including batch in the differential analysis model, the variability due to the batch effect is accounted for when calculating p-values. In this sense, batch effects are best handled as part of the differential analysis model. However, clustering data or visualizing biological effects can be very difficult if batch effects are present in the original data. We transform the original values to remove the batch effect using this tool.

We recommend normalizing your data to log normal distribution prior to removing batch effects using this method, but the task will run on any counts data node.

* Click the counts data node
* Click the **Batch removal** section of the toolbox
* Click **General linear model**

The batch effect removal dialog is similar to the dialog for ANOVA. To set up the model, you need to choose factors and interaction of factors based on your experiment design in addition to attribute(s) represent batch you would like to remove.

For example, in the case where you have samples from different cell types, treatment, they are from different batches, batch may have a different effect on different cell types and/or different treatment, you would need to include both treatment, cell type, batch and maybe the interaction between treatment and cell type in the model.

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

* Select the *Remove* checkbox for **batch**
* Click **Finish** to run

The output of is a new data node, contains the batch effect corrected values, but the treatment and cell type variation is still kept. It can be used as the input for downstream tasks.

## References

1. Fisher, R. A. (1925). *Statistical Methods for Research Workers.* \[Edinburgh: Oliver & Boyd]. The landmark text that originally introduced the statistical procedures and terminology for ANOVA to a broad research audience.


---

# 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/batch-removal/general-linear-model.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.
