Search
Question: Construct design matrix for qPCR data using Limma package
0
gravatar for Hongda Chen
3.7 years ago by
Hongda Chen20
Hongda Chen20 wrote:
Dear R-users, I am facing a problem in constructing design matrix. My data is qPCR data, analysing 92 protein markers in 92 samples (two groups). I would like to use Limma package to identify differently expressed genes between two groups. The first 38 samples were controls, and the other 54 samples were cases. So how should I construct the design matrix. I have tried the following code. Is this right? design<-matrix(rep(1,184),nrow=92,byrow=TRUE) design[39:92,1]=0 design[1:38,2]=0 colnames(design2)<-c("control","case") Could anyone help me figure out it? Thank you. Adam [[alternative HTML version deleted]]
ADD COMMENTlink modified 3.7 years ago • written 3.7 years ago by Hongda Chen20
0
gravatar for James W. MacDonald
3.7 years ago by
United States
James W. MacDonald44k wrote:
Hi Adam, That's one way of doing it. Well, except for the last line where you substitute in an apparently nonexistent design2 object. Another way would be fact <- factor(rep(c("Control","Case"), c(38,54)), levels = c("Control","Case")) design <- model.matrix(~ 0 + fact) colnames(design) <- gsub("fact", "", colnames(design)) Best, Jim On Wednesday, November 27, 2013 10:29:13 AM, Hongda Chen wrote: > Dear R-users, > > I am facing a problem in constructing design matrix. My data is qPCR data, > analysing 92 protein markers in 92 samples (two groups). I would like to > use Limma package to identify differently expressed genes between two > groups. The first 38 samples were controls, and the other 54 samples were > cases. So how should I construct the design matrix. > > I have tried the following code. Is this right? > design<-matrix(rep(1,184),nrow=92,byrow=TRUE) > design[39:92,1]=0 > design[1:38,2]=0 > colnames(design2)<-c("control","case") > > Could anyone help me figure out it? Thank you. > > Adam > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician University of Washington Environmental and Occupational Health Sciences 4225 Roosevelt Way NE, # 100 Seattle WA 98105-6099
ADD COMMENTlink written 3.7 years ago by James W. MacDonald44k
0
gravatar for Hongda Chen
3.7 years ago by
Hongda Chen20
Hongda Chen20 wrote:
Dear R-users, I am facing a problem in constructing design matrix. My data is qPCR data, analysing 92 protein markers in 92 samples (two groups). I would like to use Limma package to identify differently expressed genes between two groups. The first 38 samples were controls, and the other 54 samples were cases. So how should I construct the design matrix. I have tried the following code. Is this right? design<-matrix(rep(1,184),nrow=92,byrow=TRUE) design[39:92,1]=0 design[1:38,2]=0 colnames(design2)<-c("control","case") Could anyone help me figure out it? Thank you. Adam [[alternative HTML version deleted]]
ADD COMMENTlink written 3.7 years ago by Hongda Chen20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 145 users visited in the last hour