Created
June 13, 2014 16:22
-
-
Save johnstantongeddes/70eb26acd8353792166b to your computer and use it in GitHub Desktop.
Challenge to fit a lm to every "gene" in df
This file contains hidden or 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
df <- data.frame(gene = rep(c(paste("gene", 1:10, sep="")), 5), | |
treatment = rep(paste("trt", 1:5, sep=""), each=10), | |
temp = rep(1:5, each=10), | |
exp = rnorm(50)) | |
head(df) | |
# lm for a single gene | |
lmout <- lm(exp ~ temp, data = df[df$gene == "gene1", ]) | |
summary(lmout) | |
# note "p-value" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment