Zhengdeng Lei, PhD
Zhengdeng Lei, PhD
2007 - 2009 High Throughput Computational Analyst, Memorial Sloan-Kettering Cancer Center, New York
2003 - 2007 PhD, Bioinformatics, University of Illinois at Chicago
Friday, March 22, 2013
eval(parse(text = command))
setwd("E:\\Projects\\8.ComBAT\\ComBat201\\NormalMarker")
data <- read.table("ComBat201T_orderbyDIM.txt", header = T, sep = "\t", row.names=1)
attach(data)
data <- subset(data, T.Stage >= 1 & T.Stage <=4 & T.Stage !="" & T.Stage != " ")
vars <- colnames(data)
res.out <- vector()
res.out[1] <- paste("model", "r.squared", "regression.coef", "coef.pval", sep=", ")
for (i in 6:26)
{
command <- paste("lm(", vars[i], " ~ T.Stage)", sep="")
lm.res <- eval(parse(text = command))
summary(lm.res)$r.squared
summary(lm.res)$coefficients[2] #regression.coef
summary(lm.res)$coefficients[8] #coef.pval
res.out[i-4] <- paste(command, summary(lm.res)$r.squared, summary(lm.res)$coefficients[2], summary(lm.res)$coefficients[8], sep=", ")
}
write.table(res.out, file="linear.model.T.Stage.txt", sep = "\t", quote=F, row.names=F, col.name=F)
pdf(file="plot.T.Stage.pdf")
op <- par(mfrow = c(3, 2), # 3 x 2 pictures on one plot
mar = c(4,0.1,0.1,0.1),
pty = "s") # square plotting region,
# independent of device T.Stage
for (i in 6:26)
{
command <- paste("plot(", vars[i], " ~ T.Stage, col ='green')", sep="")
plot.res <- eval(parse(text = command))
}
dev.off()
## At end of plotting, reset to previous settings:
par(op)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment