**20**wrote:

Hi

In the context of microarray analysis, how to check whether experimental covariates (age/gender) are confounded with our grouping of interest (ie diseased vs normal)?

```
goi = sample(letters[1:2], 20, T) # group of interest
cov=list() #3 covariates
cov$c1=sample(letters[1:4], 20, T)
cov$c2=sample(letters[1:5], 20, T)
cov$c3=sample(letters[1:2], 20, T)
numeric_covar= sample (c(25:60), 20, T)
```

**Approach1- chisq.test**

```
sapply(names(cov), function (x)
chisq.test (cov[[x]], goi) $p.value) # not for numeric_covar
```

**Appraoch2- Anova/t.test**

```
sapply(names(cov), function (x) # suitable for *numeric_covar* as well.
anova(lm( as.numeric(as.factor(cov[[x]])) ~ as.numeric(as.factor(goi))))$'Pr(>F)'[1])
```

I think the numeric_covar can only be dealt with the second approach.