Created
October 22, 2014 20:05
-
-
Save mikelove/74bff8ef1e00de8b704f to your computer and use it in GitHub Desktop.
does batch average out?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
batch <- factor(rep(1:3,length=10)) | |
beta2 <- 2 | |
beta3 <- 4 | |
mu <- (batch == "2") * beta2 + (batch == "3") * beta3 | |
n <- 100000 | |
y <- t(replicate(n, rnorm(6, mean=sample(mu,6), sd=1))) | |
condition <- factor(rep(1:2,each=3)) | |
library(genefilter) | |
ts <- rowttests(y, condition) | |
hist(ts$p.value, breaks=100, col="grey") | |
abline(h=n/100, col="red", lwd=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment