Entering edit mode

I am trying to use the ComBat() function of the R package sva for batch effect correction of RNA microarrays. In the data, each column represents each sample, and each row represents each gene.

My question is, do I need to standardize or centralize before ComBat? I know the results will be different for patterns 1-3, but which is the correct analysis? Or tell me which method you are using? Thank you.

```
library(sva)
# read normalized data
nor_data <- read.csv("RNA_input.csv", header=T)
# for mod
group_mod <- data.frame(group=group_label)
mod <- model.matrix(~ as.factor(group), data = group_mod)
```

# pattern 1

Without standardization

```
dat_for_ComBat <- nor_dat
ComBat_data <- ComBat(dat=dat_for_ComBat, batch=as.factor(batch_label), mod=mod, par.prior = TRUE, prior.plots = FALSE)
```

# pattern 2

With standardization

```
dat_for_ComBat <- scale(nor_dat, center = TRUE, scale = TRUE)
ComBat_data <- ComBat(dat=dat_for_ComBat, batch=as.factor(batch_label), mod=mod, par.prior = TRUE, prior.plots = FALSE)
```

# pattern 3

With centralization

```
dat_for_ComBat <- scale(nor_dat, center = TRUE, scale = FALSE)
ComBat_data <- ComBat(dat=dat_for_ComBat, batch=as.factor(batch_label), mod=mod, par.prior = TRUE, prior.plots = FALSE)
```

Thank you very much!