Skip to content

Instantly share code, notes, and snippets.

@mikelove
Created October 22, 2014 20:05
Show Gist options
  • Save mikelove/74bff8ef1e00de8b704f to your computer and use it in GitHub Desktop.
Save mikelove/74bff8ef1e00de8b704f to your computer and use it in GitHub Desktop.
does batch average out?
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