Design matrix with multiple genotypes + quantified variables
0
0
Entering edit mode
@matthew-hannah-621
Last seen 9.6 years ago
Hi, After asking before this design and contrast matrix was suggested and it worked well. But now it gets complicated? 2 genotypes - Con, Mut 2 treatments - A, N. 4 replicates treatments <- factor(c(1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4)) design <- model.matrix(~ 0+treatments) colnames(design) <- c("ConA","ConN","MutA","MutN") fit <- lmFit(esetgcrma, design) cont.matrix <- makeContrasts(ConA-MutA, ConN-MutN, Gen=(ConN+ConA-MutN-MutA)/2, ConA-ConN, MutA-MutN, treatment=(ConA+MutA-ConN-MutN)/2,levels=design) con.fit <- contrasts.fit(fit, cont.matrix) So what if I add a third genotype - Mut2? Is it the obvious add treatments <- .....5,5,5,5,6,6,6,6)) and then for the contrasts treatment=(ConA+MutA+Mut2A-ConN-MutN-Mut2N)/3) Or am I misunderstanding how to design contrasts? Is there an easier way of writing this when you have more genotypes? Also logically the lm is treating all samples as independent when they are not, does this matter? Is it possible to fit the original lm using a design taking genotype and treatment into account? Would this be a better approach, especially as if you have more genotypes (eg:5-10). What would the design matrix then look like? Finally, what if you have a quantified variable for each genotype like a measure of growth before and after the treatment. Can you specify this in anyway (in the design matrix?) so you take this into account during the fit. I thought this was possible using lm or rlm, or am I confusing something? Alternatively, does anyone have a different approach, such as an efficient way of doing a gene-by-gene regression or correlation analysis against the growth measure, and extracting the genes that correlate best with the growth measure? Perhaps there is there a good (biologist simple?) book that would cover design and contrast of lms, anyone know of one? Thanks again, Matt
Regression Regression • 672 views
ADD COMMENT

Login before adding your answer.

Traffic: 943 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6