limma
1
0
Entering edit mode
@claire-vandiedonck-3585
Last seen 9.6 years ago
Hi everyone, I am not a statistician, so please forgive me if my question is trivial. I have some difficulties with the factorial design in limma with 2 factors with 2 and 3 levels respectively. Say the two factors are "Treatment" and "Source", with respectively two and three levels: >Treatment [1] No No No Yes Yes Yes No No No Yes Yes Yes No No No Yes Yes Yes Levels: No Yes > Source [1] RNA1 RNA1 RNA1 RNA1 RNA1 RNA1 RNA2 RNA2 RNA2 RNA2 RNA2 RNA2 RNA3 RNA3 RNA3 RNA3 RNA3 RNA3 Levels: RNA1 RNA2 RNA3 I have three replicates of each condition per source, hence 18 arrays (which are Affymetrix). My target is as follow: Source Treatment 1 RNA1 No 2 RNA1 No 3 RNA1 No 4 RNA1 Yes 5 RNA1 Yes 6 RNA1 Yes 7 RNA2 No 8 RNA2 No 9 RNA2 No 10 RNA2 Yes 11 RNA2 Yes 12 RNA2 Yes 13 RNA3 No 14 RNA3 No 15 RNA3 No 16 RNA3 Yes 17 RNA3 Yes 18 RNA3 Yes I create the following design matrix: design <- model.matrix(~0+Treatment*Source) and apply the linear model: fit <- lmFit(data, designl) But then I fail in making the contrasts. I only manage to get pairwise effects, while I would like the following three effects: main effect of the treatment, main effect of the source, interaction between effect and source. Could any one help me please? Alternatively, I used the group parametrization approach with one factor with 6 levels corresponding to my 6 combinations. This way, I managed to extract each of my contrasts of interest, but I would really like to understand how to use limma in a more classical statistical way, like in a two-way anova. Any help would be very much appreciated as my data are susceptible to get more complicated with additional treatments and even paired samples. Many thanks in advance. BW Claire -- Claire Vandiedonck, PhD Post-doctoral scientist Wellcome Trust Centre for Human Genetics Oxford University Roosevelt Drive Oxford, OX3 7BN office: +44(0)1865 287 829 lab: +44(0)1865 287 531 mail: vandiedo at well.ox.ac.uk
limma limma • 743 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 13 hours ago
United States
Hi Claire, Claire Vandiedonck wrote: > Hi everyone, > > I am not a statistician, so please forgive me if my question is trivial. > I have some difficulties with the factorial design in limma with 2 > factors with 2 and 3 levels respectively. > > Say the two factors are "Treatment" and "Source", with respectively two > and three levels: > >Treatment > [1] No No No Yes Yes Yes No No No Yes Yes Yes No No No Yes Yes Yes > Levels: No Yes > > Source > [1] RNA1 RNA1 RNA1 RNA1 RNA1 RNA1 RNA2 RNA2 RNA2 RNA2 RNA2 RNA2 RNA3 > RNA3 RNA3 RNA3 RNA3 RNA3 > Levels: RNA1 RNA2 RNA3 > > I have three replicates of each condition per source, hence 18 arrays > (which are Affymetrix). > My target is as follow: > Source Treatment > 1 RNA1 No > 2 RNA1 No > 3 RNA1 No > 4 RNA1 Yes > 5 RNA1 Yes > 6 RNA1 Yes > 7 RNA2 No > 8 RNA2 No > 9 RNA2 No > 10 RNA2 Yes > 11 RNA2 Yes > 12 RNA2 Yes > 13 RNA3 No > 14 RNA3 No > 15 RNA3 No > 16 RNA3 Yes > 17 RNA3 Yes > 18 RNA3 Yes > > I create the following design matrix: > design <- model.matrix(~0+Treatment*Source) > > and apply the linear model: > fit <- lmFit(data, designl) > > But then I fail in making the contrasts. I only manage to get pairwise > effects, while I would like the following three effects: main effect of > the treatment, main effect of the source, interaction between effect and > source. Could any one help me please? You only need one contrast. The first and second coefficients of your design matrix are for the main effect of treatment, so you need a contrast matrix of matrix(c(-1,1,0,0,0,0), ncol = 1) to get that contrast. The third and fourth coefficients capture the differences between RNA2 and RNA1, and RNA3 and RNA1 respectively, so that is your main effect for source. If by main effect you want the F-statistic for the overall test of any difference between the sources, then you can get that using topTable() and subsetting your MArrayLM object. Say you do this: fit2 <- eBayes(fit) then topTable(fit2[,3:4]) will give you the F-stats for that main effect. The fifth and sixth coefficients give you the interaction terms (there are two since you have three levels of RNA source). The fifth coefficient gives the interaction between RNA1 and RNA2 over the two treatments and the sixth coefficient gives the interaction between RNA1 and RNA3 over the two treatments. Again, you can get the F-statistic for any interaction using topTable and subsetting your MArrayLM object accordingly. Best, Jim > > Alternatively, I used the group parametrization approach with one factor > with 6 levels corresponding to my 6 combinations. This way, I managed to > extract each of my contrasts of interest, but I would really like to > understand how to use limma in a more classical statistical way, like in > a two-way anova. Any help would be very much appreciated as my data are > susceptible to get more complicated with additional treatments and even > paired samples. Many thanks in advance. > > BW > > Claire > > -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826
ADD COMMENT

Login before adding your answer.

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