[BioC] EdgeR: coefficients for GLM for multiple groups
James W. MacDonald
jmacdon at uw.edu
Thu Mar 21 22:17:19 CET 2013
I think you are fundamentally misunderstanding what you are doing. In
the context of a glm, the way you test for the significance of a
coefficient is by doing a likelihood ratio test, comparing a model that
contains the coefficient to a reduced model that does not. So there
won't be any p-values without making a comparison.
In other words, the glmFit step sets up the model, and the glmLRT step
does the test for whatever coefficient you care about. By default it
tests all coefficients. From ?glmLRT:
glmLRT conducts likelihood ratio tests for one or more
coefficients in the linear model. If coef is used, the null
hypothesis is that all the coefficients indicated by coef are
equal to zero. If contrast is non-null, then the null hypothesis
is that the specified contrast of the coefficients is equal to
zero. For example, a contrast of c(0,1,-1), assuming there are
three coefficients, would test the hypothesis that the second and
third coefficients are equal.
Best,
Jim
On 3/21/2013 4:55 PM, capricy gao wrote:
> I wonder if there are different versions of userguide/reference manual.
>
> I still couldn't find what I could do to get useful output, like the
> pvalue for all the coefficients.
>
> The only pvalue I could see is in lrt output...
>
>
> ------------------------------------------------------------------------
> *From:* James W. MacDonald <jmacdon at uw.edu>
> *To:* capricy gao <capricyg at yahoo.com>
> *Cc:* "bioconductor at r-project.org" <bioconductor at r-project.org>
> *Sent:* Thursday, March 21, 2013 3:27 PM
> *Subject:* Re: [BioC] EdgeR: coefficients for GLM for multiple groups
>
> Hi Capricy,
>
> I'm not convinced you have read the user's guide carefully. There is,
> for example, a section called 'Quick start' that is only seven pages
> in, that shows the canonical glm analysis steps. Then there are two
> more worked examples starting on page 52 that show pretty much all the
> steps required to do a glm analysis.
>
> However, in the code you show below you haven't followed the examples,
> nor have you used the accessor function that is intended to produce
> useful output.
>
> Best,
>
> Jim
>
>
>
> On 3/21/2013 3:57 PM, capricy gao wrote:
> > I think I have carefully read both the userguide and reference
> manual, but couldn't figure it out. Could anybody help me out what
> arguments should be included? Thanks a lot.
> >
> > In limma fit results: there is something like this:
> > ===============
> > $p.value
> > Grp1 Grp2vs1
> > Gene 1 0.8604469 6.019156e-05
> > Gene 2 0.2174605 1.673262e-05
> > Gene 3 0.3571957 5.758422e-02
> > Gene 4 0.6789641 1.758690e-01
> > Gene 5 0.4589329 8.223679e-01
> > 95 more rows ...
> > ==============
> >
> > But in edgeR I couldn't find it as I posted previously....
> >
> >
> > ------------------------------------------------------------------------
> > *From:* James W. MacDonald <jmacdon at uw.edu <mailto:jmacdon at uw.edu>>
> > *To:* capricy gao <capricyg at yahoo.com <mailto:capricyg at yahoo.com>>
> > *Cc:* "bioconductor at r-project.org
> <mailto:bioconductor at r-project.org>" <bioconductor at r-project.org
> <mailto:bioconductor at r-project.org>>
> > *Sent:* Thursday, March 21, 2013 1:45 PM
> > *Subject:* Re: [BioC] EdgeR: coefficients for GLM for multiple groups
> >
> > Hi Capricy,
> >
> > Just like limma, edgeR has a very comprehensive user's guide that you
> > can consult.
> >
> > library(edgeR)
> > edgeRUsersGuide()
> >
> > Best,
> >
> > Jim
> >
> >
> >
> > On 3/21/2013 2:41 PM, capricy gao wrote:
> > > I am looking at my fit results from GLM of edgeR for my data:
> > >
> > > and assume that $coefficients are related to the expression
> levels. Just wondering how I can get the p values for those
> coefficients since I remember in limma, each coefficient will be
> accompanied by the corresponding t value and p value.
> > >
> > >
> > > Thanks a lot for the help.
> > >
> > > capricy
> > >
> > > ===================
> > >
> > >> design=model.matrix(~0+regroup)
> > >> y<- estimateGLMCommonDisp(y,design)
> > >> y<- estimateGLMTagwiseDisp(y,design)
> > >> fit<- glmFit(y,design)
> > >> fit
> > > An object of class "DGEGLM"
> > > $coefficients
> > > regroupFR regroupFA regroupFM regroupFP regroupFW
> regroupMA
> > > GS_14929 -9.543565 -9.267612 -9.310823 -9.167299 -10.62094
> -9.260763
> > > GS_09776 -10.304430 -10.985146 -10.644154 -10.640469 -10.59615
> -10.798889
> > > GS_18434 -11.327664 -11.786421 -11.643292 -11.902728 -12.50470
> -11.654008
> > > GS_08334 -10.789181 -10.271089 -10.511480 -10.375642 -10.39865
> -10.836647
> > > GS_09550 -10.564167 -10.152571 -10.410428 -10.098825 -10.36302
> -9.722892
> > > regroupMM regroupMP regroupMW
> > > GS_14929 -8.516256 -8.222225 -9.495394
> > > GS_09776 -10.337434 -10.284703 -10.588544
> > > GS_18434 -11.755905 -11.662276 -11.583950
> > > GS_08334 -10.797529 -10.643409 -10.783104
> > > GS_09550 -10.650495 -10.766462 -9.880359
> > > 15457 more rows ...
> > >
> > > $fitted.values
> > > MP FA FR FW MA
> FW.1 MM
> > > GS_14929 596.53153 205.75696 84.61834 31.844025 169.27178
> 82.62258 513.34590
> > > GS_09776 75.81638 36.91137 39.53083 32.643715 36.33823
> 84.69746 83.04882
> > > GS_18434 19.09812 16.54813 14.19827 4.825192 15.43876
> 12.51946 20.07922
> > > GS_08334 52.95485 75.41272 24.33895 39.775089 34.99088
> 103.20054 52.41066
> > > GS_09550 46.82022 84.90529 30.48442 41.218519 106.62251
> 106.94567 60.71721
> > > FP MA.1 MW FM MM.1
> MW.1 MP.1
> > > GS_14929 78.226172 123.52247 193.95899 122.61523 173.571103
> 194.05252 568.23926
> > > GS_09776 17.921685 26.51705 64.98434 32.30797 28.080239
> 65.01567 72.22056
> > > GS_18434 5.064548 11.26610 23.99487 11.88420 6.789129
> 24.00644 18.19234
> > > GS_08334 23.358730 25.53385 53.48880 36.89427 17.720948
> 53.51460 50.44331
> > > GS_09550 30.811447 77.80550 131.97315 40.81919 20.529537
> 132.03679 44.59963
> > > FM.1 FP.1 FA.1 FR.1
> > > GS_14929 259.44483 324.86875 256.36216 198.47462
> > > GS_09776 68.36129 74.42772 45.98959 92.72063
> > > GS_18434 25.14609 21.03277 20.61808 33.30242
> > > GS_08334 78.06556 97.00745 93.96021 57.08766
> > > GS_09550 86.37041 127.95815 105.78744 71.50204
> > > 15457 more rows ...
> > >
> > > $counts
> > > MP FA FR FW MA FW.1 MM FP MA.1 MW FM MM.1 MW.1
> MP.1 FM.1 FP.1
> > > GS_14929 221 284 170 23 267 105 209 106 52 218 158 277 170
> 926 185 211
> > > GS_09776 75 32 17 28 41 96 86 15 23 65 23 27 65 73
> 87 85
> > > GS_18434 36 22 19 8 21 6 22 7 7 27 13 6 21
> 2 23 15
> > > GS_08334 44 77 23 50 41 78 78 14 21 61 29 8 46 59
> 94 132
> > > GS_09550 82 92 45 54 105 75 95 18 79 153 41 8 111 11
> 86 178
> > > FA.1 FR.1
> > > GS_14929 159 0
> > > GS_09776 52 143
> > > GS_18434 14 23
> > > GS_08334 92 60
> > > GS_09550 97 39
> > > 15457 more rows ...
> > >
> > > $deviance
> > > GS_14929 GS_09776 GS_18434 GS_08334 GS_09550
> > > 19.059229 3.629342 9.509356 4.268291 8.809585
> > > 15457 more elements ...
> > >
> > > $df.residual
> > > [1] 9 9 9 9 9
> > > 15457 more elements ...
> > >
> > > $abundance
> > > [1] -9.081235 -10.552328 -11.717230 -10.579804 -10.233947
> > > 15457 more elements ...
> > >
> > > $design
> > > regroupFR regroupFA regroupFM regroupFP regroupFW regroupMA
> regroupMM
> > > 1 0 0 0 0 0 0 0
> > > 2 0 1 0 0 0 0 0
> > > 3 1 0 0 0 0 0 0
> > > 4 0 0 0 0 1 0 0
> > > 5 0 0 0 0 0 1 0
> > > regroupMP regroupMW
> > > 1 1 0
> > > 2 0 0
> > > 3 0 0
> > > 4 0 0
> > > 5 0 0
> > > 13 more rows ...
> > >
> > > $offset
> > > [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
> > > [1,] 14.61341 14.59445 13.9819 14.08233 14.39241 15.03576 14.75727
> 13.52703
> > > [2,] 14.61341 14.59445 13.9819 14.08233 14.39241 15.03576 14.75727
> 13.52703
> > > [3,] 14.61341 14.59445 13.9819 14.08233 14.39241 15.03576 14.75727
> 13.52703
> > > [4,] 14.61341 14.59445 13.9819 14.08233 14.39241 15.03576 14.75727
> 13.52703
> > > [5,] 14.61341 14.59445 13.9819 14.08233 14.39241 15.03576 14.75727
> 13.52703
> > > [,9] [,10] [,11] [,12] [,13] [,14] [,15]
> [,16]
> > > [1,] 14.07733 14.76322 14.12002 13.67291 14.7637 14.56482 14.86951
> 14.95085
> > > [2,] 14.07733 14.76322 14.12002 13.67291 14.7637 14.56482 14.86951
> 14.95085
> > > [3,] 14.07733 14.76322 14.12002 13.67291 14.7637 14.56482 14.86951
> 14.95085
> > > [4,] 14.07733 14.76322 14.12002 13.67291 14.7637 14.56482 14.86951
> 14.95085
> > > [5,] 14.07733 14.76322 14.12002 13.67291 14.7637 14.56482 14.86951
> 14.95085
> > > [,17] [,18]
> > > [1,] 14.81434 14.83441
> > > [2,] 14.81434 14.83441
> > > [3,] 14.81434 14.83441
> > > [4,] 14.81434 14.83441
> > > [5,] 14.81434 14.83441
> > > 15457 more rows ...
> > >
> > > $dispersion
> > > [1] 0.7464955 0.2734189 0.4034924 0.2832934 0.3819788
> > > 15457 more elements ...
> > >
> > > $method
> > > [1] "oneway"
> > >
> > > $samples
> > > group lib.size norm.factors
> > > MP MP 2220863 1
> > > FA FA 2179157 1
> > > FR FR 1181036 1
> > > FW FW 1305802 1
> > > MA MA 1780507 1
> > > 13 more rows ...
> > > [[alternative HTML version deleted]]
> > >
> > >
> > >
> > > _______________________________________________
> > > Bioconductor mailing list
> > > Bioconductor at r-project.org <mailto:Bioconductor at r-project.org>
> <mailto:Bioconductor at r-project.org <mailto: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
> >
> >
> >
>
> -- James W. MacDonald, M.S.
> Biostatistician
> University of Washington
> Environmental and Occupational Health Sciences
> 4225 Roosevelt Way NE, # 100
> Seattle WA 98105-6099
>
>
>
--
James W. MacDonald, M.S.
Biostatistician
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099
More information about the Bioconductor
mailing list