Limma, model with several factors
2
0
Entering edit mode
Guest User ★ 13k
@guest-user-4897
Last seen 10.1 years ago
I have carefully read the Limma users guide but still have not sorted out how I design the contrasts for the following Project. In want to compare the effect (After vs before) of two different treatments, F and P. The study was carried our in two different centers. This can be illustrated as follows: Subject center treatment timepoint 1 1 F B 1 1 F A 2 1 P B 2 1 P A 3 2 F B 3 2 F A 4 2 P B 4 2 P A I want to compare (F.A-F.B)-(P.A-P.B), blocking for subject. However, in addition, I would like to block for center. I.e. the center is like a batch effect. Is it possible to block for two factors, suject and center, in the same test in Limma? /Ingrid -- output of sessionInfo(): See section 8.7 in the user guide. -- Sent via the guest posting facility at bioconductor.org.
limma limma • 1.1k views
ADD COMMENT
0
Entering edit mode
@ryan-c-thompson-5618
Last seen 2 days ago
Icahn School of Medicine at Mount Sinaiā€¦
Ingrid, It is possible to block for any number of factors in limma. However, if you try to block for subject in the experiment that you showed, you will find that you don't have enough replicates to do so. The combination of treatment and timepoint contributes 4 degrees of freedom to your model, and subject would contribute 4 more, for a total of 8. This is the same as the number of samples in your experiment, which means that you have no remaining degrees of freedom. It would be analogous to trying to calculate the standard deviation of a single sample. Your best option is probably to block only for center and not subject. -Ryan On Mon May 20 01:01:08 2013, Ingrid Dahlman [guest] wrote: > > I have carefully read the Limma users guide but still have not sorted out how I design the contrasts for the following Project. > > In want to compare the effect (After vs before) of two different treatments, F and P. The study was carried our in two different centers. This can be illustrated as follows: > Subject center treatment timepoint > 1 1 F B > 1 1 F A > 2 1 P B > 2 1 P A > 3 2 F B > 3 2 F A > 4 2 P B > 4 2 P A > I want to compare (F.A-F.B)-(P.A-P.B), blocking for subject. However, in addition, I would like to block for center. I.e. the center is like a batch effect. > Is it possible to block for two factors, suject and center, in the same test in Limma? > /Ingrid > > -- output of sessionInfo(): > > See section 8.7 in the user guide. > > -- > Sent via the guest posting facility at bioconductor.org. > > _______________________________________________ > 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
ADD COMMENT
0
Entering edit mode
Oops, I realized that subject only has 3 degrees of freedom, so as Gordon explained, you are perfectly fine blocking on subject. On Mon May 20 09:44:28 2013, Ryan C. Thompson wrote: > Ingrid, > > It is possible to block for any number of factors in limma. However, > if you try to block for subject in the experiment that you showed, you > will find that you don't have enough replicates to do so. The > combination of treatment and timepoint contributes 4 degrees of > freedom to your model, and subject would contribute 4 more, for a > total of 8. This is the same as the number of samples in your > experiment, which means that you have no remaining degrees of freedom. > It would be analogous to trying to calculate the standard deviation of > a single sample. Your best option is probably to block only for center > and not subject. > > -Ryan > > On Mon May 20 01:01:08 2013, Ingrid Dahlman [guest] wrote: >> >> I have carefully read the Limma users guide but still have not sorted >> out how I design the contrasts for the following Project. >> >> In want to compare the effect (After vs before) of two different >> treatments, F and P. The study was carried our in two different >> centers. This can be illustrated as follows: >> Subject center treatment timepoint >> 1 1 F B >> 1 1 F A >> 2 1 P B >> 2 1 P A >> 3 2 F B >> 3 2 F A >> 4 2 P B >> 4 2 P A >> I want to compare (F.A-F.B)-(P.A-P.B), blocking for subject. >> However, in addition, I would like to block for center. I.e. the >> center is like a batch effect. >> Is it possible to block for two factors, suject and center, in the >> same test in Limma? >> /Ingrid >> >> -- output of sessionInfo(): >> >> See section 8.7 in the user guide. >> >> -- >> Sent via the guest posting facility at bioconductor.org. >> >> _______________________________________________ >> 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
ADD REPLY
0
Entering edit mode
@gordon-smyth
Last seen 7 hours ago
WEHI, Melbourne, Australia
Dear Ingrid, If you block on subject (as in Section 8.4 of the User's Guide), then you have automatically blocked on center as well, because the subjects are different in the two centers. You experiment can be analyzed as suggested in Section 8.4.2 of the User's Guide. First combine treatment and timepoint into one factor (following Section 8.5.2): Treat.Time <- factor(paste(treatment,timepoint,sep=".")) Then make a design matrix including the blocking factor: design <- model.matrix(~0+Treat.Time+Subject) colnames(design)[1:4] <- levels(Treat.Time) cont.matrix <- makeContrasts((F.A-F.B)-(P.A-P.B),levels=design) etc. The rule is that the experimental factors of interest are combined into the treatment factors, whereas the nuisance factors are blocked on. Best wishes Gordon > Date: Mon, 20 May 2013 01:01:08 -0700 (PDT) > From: "Ingrid Dahlman [guest]" <guest at="" bioconductor.org=""> > To: bioconductor at r-project.org, ingrid.dahlman at ki.se > Subject: [BioC] Limma, model with several factors > > > I have carefully read the Limma users guide but still have not sorted > out how I design the contrasts for the following Project. > > In want to compare the effect (After vs before) of two different > treatments, F and P. The study was carried our in two different centers. > This can be illustrated as follows: > Subject center treatment timepoint > 1 1 F B > 1 1 F A > 2 1 P B > 2 1 P A > 3 2 F B > 3 2 F A > 4 2 P B > 4 2 P A > I want to compare (F.A-F.B)-(P.A-P.B), blocking for subject. However, in > addition, I would like to block for center. I.e. the center is like a > batch effect. > Is it possible to block for two factors, suject and center, in the same > test in Limma? > /Ingrid > > -- output of sessionInfo(): > > See section 8.7 in the user guide. > > -- > Sent via the guest posting facility at bioconductor.org. > ______________________________________________________________________ The information in this email is confidential and intend...{{dropped:4}}
ADD COMMENT

Login before adding your answer.

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