...
Code Block |
---|
library(lattice) xyplot(u$v[,1]~factor(batch),main="1") xyplot(u$v[,2]~factor(batch),main="2") xyplot(u$v[,3]~factor(batch),main="3") xyplot(u$v[,4]~factor(batch),main="4") |
Kruskal-Wallis test for association of each egengene with batch:
Code Block |
---|
> kruskal.test(u507$v[,1],shortBatch)
Kruskal-Wallis rank sum test
data: u507$v[, 1] and shortBatch
Kruskal-Wallis chi-squared = 126.2598, df = 12, p-value < 2.2e-16
> kruskal.test(u507$v[,2],shortBatch)
Kruskal-Wallis rank sum test
data: u507$v[, 2] and shortBatch
Kruskal-Wallis chi-squared = 44.3239, df = 12, p-value = 1.345e-05
> kruskal.test(u507$v[,3],shortBatch)
Kruskal-Wallis rank sum test
data: u507$v[, 3] and shortBatch
Kruskal-Wallis chi-squared = 22.1812, df = 12, p-value = 0.03554
> kruskal.test(u507$v[,4],shortBatch)
Kruskal-Wallis rank sum test
data: u507$v[, 4] and shortBatch
Kruskal-Wallis chi-squared = 62.7275, df = 12, p-value = 7.152e-09
|
Remove batch effect:
Code Block |
---|
X<-model.matrix(~factor(batch)) bch <- solve(t(X) %*% X) %*% t(X) %*% t(expr) resExpr <- expr-t(X %*% bch) |
...