Designing a model with blocking and other interactions
1
0
Entering edit mode
Eleanor Su ▴ 110
@eleanor-su-6460
Last seen 9.6 years ago
Hi Gordon, I just wanted to elaborate on this email that I got from you back in April. This design that you sent me: design1 <- model.matrix(~Family) design2 <- model.matrix(~mitoHap*Treatment) design <- cbind(design1,design2[,3:4]) Does it account for Family as a blocking factor? Also, if I increase the number of samples for the analysis (for example 20, instead of 10), does this command below change? design <- cbind(design1,design2[,3:4]) Sorry if these seem like naive questions. I'm just trying to get a better understanding of the design matrix. Thanks for your help. Best, Eleanor On Wed, Apr 2, 2014 at 8:25 PM, Gordon K Smyth <smyth@wehi.edu.au> wrote: > Dear Eleanor, > > design1 <- model.matrix(~Family) > design2 <- model.matrix(~mitoHap*Treatment) > design <- cbind(design1,design2[,3:4]) > > Then test for the last coefficient. > > Best wishes > Gordon > > Date: Tue, 1 Apr 2014 11:24:52 -0700 >> From: Eleanor Su <eleanorjinsu@gmail.com> >> To: "bioconductor@stat.math.ethz.ch" <bioconductor@stat.math.ethz.ch> >> Subject: [BioC] Designing a model with blocking and other interactions >> >> Hi All, >> >> I'm trying to set up a model matrix where I can look at the interaction >> between Treatment and mitochondrial haplotypes in my paired samples. These >> are the preliminary commands that I've set up: >> >> rawdata<-read.delim("piRNAtotalcount<10.txt", check.names=FALSE, >>> >> stringsAsFactors=FALSE) >> >>> y <- DGEList(counts=rawdata[,2:11], genes=rawdata[,1]) >>> Family<-factor(c(6,6,9,9,11,11,26,26,28,28)) >>> Treatment<-factor(c("C","H","C","H","C","H","C","H","C","H")) >>> mitoHap<-factor(c("S","S","S","S","S","S","D","D","D","D")) >>> data.frame(Sample=colnames(y),Family,Treatment,mitoHap) >>> >> Sample Family Treatment mitoHap >> 1 6C (S) 6 C S >> 2 6H (S) 6 H S >> 3 9C (S) 9 C S >> 4 9H (S) 9 H S >> 5 11C (S) 11 C S >> 6 11H (S) 11 H S >> 7 26C (D) 26 C D >> 8 26H (D) 26 H D >> 9 28C (D) 28 C D >> 10 28H (D) 28 H D >> >> design<-model.matrix(?) >>> >> >> I have 10 sequencing samples from 5 different families (a treatment and >> control sample from each family) and two different types of mitochondrial >> haplotypes. How do I set up a design where I can look at the interaction >> between the Treatments and mitoHap while still accounting for Family? >> >> Any help would be greatly appreciated. Thank you for your time. >> >> Best, >> Eleanor >> > > ______________________________________________________________________ > The information in this email is confidential and inte...{{dropped:10}}
Sequencing Sequencing • 930 views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 5 hours ago
WEHI, Melbourne, Australia
On Fri, 18 Jul 2014, Eleanor Su wrote: > Hi Gordon, > > I just wanted to elaborate on this email that I got from you back in April. > This design that you sent me: > > design1 <- model.matrix(~Family) > design2 <- model.matrix(~mitoHap*Treatment) > design <- cbind(design1,design2[,3:4]) > > Does it account for Family as a blocking factor? Yes. > Also, if I increase the number of samples for the analysis (for example > 20, instead of 10), does this command below change? > > design <- cbind(design1,design2[,3:4]) The design I suggested works for the specific arrangement of samples in your experiment. I cannot vouch that it would be correct for an expanded experiment, especially without seeing what treatments are applied to the new samples. It would still work however if the only change is to add more families while keeping the same levels for mitoHap and Treatment. Best wishes Gordon > Sorry if these seem like naive questions. I'm just trying to get a better > understanding of the design matrix. Thanks for your help. > > Best, > Eleanor > > > On Wed, Apr 2, 2014 at 8:25 PM, Gordon K Smyth <smyth at="" wehi.edu.au=""> wrote: > >> Dear Eleanor, >> >> design1 <- model.matrix(~Family) >> design2 <- model.matrix(~mitoHap*Treatment) >> design <- cbind(design1,design2[,3:4]) >> >> Then test for the last coefficient. >> >> Best wishes >> Gordon >> >> Date: Tue, 1 Apr 2014 11:24:52 -0700 >>> From: Eleanor Su <eleanorjinsu at="" gmail.com=""> >>> To: "bioconductor at stat.math.ethz.ch" <bioconductor at="" stat.math.ethz.ch=""> >>> Subject: [BioC] Designing a model with blocking and other interactions >>> >>> Hi All, >>> >>> I'm trying to set up a model matrix where I can look at the interaction >>> between Treatment and mitochondrial haplotypes in my paired samples. These >>> are the preliminary commands that I've set up: >>> >>> rawdata<-read.delim("piRNAtotalcount<10.txt", check.names=FALSE, >>>> >>> stringsAsFactors=FALSE) >>> >>>> y <- DGEList(counts=rawdata[,2:11], genes=rawdata[,1]) >>>> Family<-factor(c(6,6,9,9,11,11,26,26,28,28)) >>>> Treatment<-factor(c("C","H","C","H","C","H","C","H","C","H")) >>>> mitoHap<-factor(c("S","S","S","S","S","S","D","D","D","D")) >>>> data.frame(Sample=colnames(y),Family,Treatment,mitoHap) >>>> >>> Sample Family Treatment mitoHap >>> 1 6C (S) 6 C S >>> 2 6H (S) 6 H S >>> 3 9C (S) 9 C S >>> 4 9H (S) 9 H S >>> 5 11C (S) 11 C S >>> 6 11H (S) 11 H S >>> 7 26C (D) 26 C D >>> 8 26H (D) 26 H D >>> 9 28C (D) 28 C D >>> 10 28H (D) 28 H D >>> >>> design<-model.matrix(?) >>>> >>> >>> I have 10 sequencing samples from 5 different families (a treatment and >>> control sample from each family) and two different types of mitochondrial >>> haplotypes. How do I set up a design where I can look at the interaction >>> between the Treatments and mitoHap while still accounting for Family? >>> >>> Any help would be greatly appreciated. Thank you for your time. >>> >>> Best, >>> Eleanor ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
ADD COMMENT

Login before adding your answer.

Traffic: 974 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