Dear all,
How can I retrieve only p-value to store it in a file after applying
anova()
on some microarray gene expression data set??
For example,
*Suppose my result is:*
*
*
*Analysis of Variance Table*
*
*
*Response: wt*
* Df Sum Sq Mean Sq F value Pr(>F) *
*treat 1 1.2100 1.2100 5.548 0.03361 **
*Residuals 14 3.0534 0.2181 *
*---*
*Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 *
I want to store only p-value(0.03361) in a file.
Thanks in advance,
Anirban
[[alternative HTML version deleted]]
This has nothing to do with Bioconductor and would be fruitfully posed
on
R-help -- if the answer were not findable otherwise.
In this case, a reproducible example is
example(lm)
names(anova(lm.D9))
anova(lm.D9)["group","Pr(>F)"]
to store the number to a file requires other facilties, see
?write.table or
the like
On Sat, Sep 10, 2011 at 10:26 PM, ANIRBAN BHAR <aec.ani@gmail.com>
wrote:
> Dear all,
>
> How can I retrieve only p-value to store it in a file after applying
> anova()
> on some microarray gene expression data set??
>
> For example,
>
> *Suppose my result is:*
> *
> *
> *Analysis of Variance Table*
> *
> *
> *Response: wt*
> * Df Sum Sq Mean Sq F value Pr(>F) *
> *treat 1 1.2100 1.2100 5.548 0.03361 **
> *Residuals 14 3.0534 0.2181 *
> *---*
> *Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 *
>
> I want to store only p-value(0.03361) in a file.
>
> Thanks in advance,
>
> Anirban
>
> [[alternative HTML version deleted]]
>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
[[alternative HTML version deleted]]
Hi,
When in doubt, use the function `str` on a variable to see its
structure:
> a <- anova(lm(y ~ x))
> str(a)
Classes 'anova' and 'data.frame': 2 obs. of 5 variables:
$ Df : int 1 8
$ Sum Sq : num 6.89 6.29
$ Mean Sq: num 6.886 0.787
$ F value: num 8.75 NA
$ Pr(>F) : num 0.0182 NA
- attr(*, "heading")= chr "Analysis of Variance Table\n" "Response:
y"
Of this we can see, that the P-values are accessible via:
> a$"Pr(>F)"
There might be some built-in accessor-function but that is up to the
reader.
`str` is useable on almost any variable, although in some cases it
might flood your console when used on a larger, more complex object.
Kind regards,
Stefan McKinnon H?j-Edwards Dept. of Genetics and Biotechnology
PhD student Faculty of Agricultural Sciences
stefan.hoj-edwards at agrsci.dk Aarhus University
Tel.: +45 8999 1291 Blichers All? 20, Postboks 50
Web: www.iysik.com DK-8830?Tjele
Tel.: +45 8999 1900
Web: www.agrsci.au.dk
------------------------------
Message: 2
Date: Sun, 11 Sep 2011 04:26:19 +0200
From: ANIRBAN BHAR <aec.ani@gmail.com>
To: bioconductor at r-project.org
Subject: [BioC] Problem to store p-value of anova() method
Message-ID:
<cac1mboukf4ic8pnylhmedq4q5dt0z17mvvh+vmitiph56z68vq at="" mail.gmail.com="">
Content-Type: text/plain
Dear all,
How can I retrieve only p-value to store it in a file after applying
anova()
on some microarray gene expression data set??
For example,
*Suppose my result is:*
*
*
*Analysis of Variance Table*
*
*
*Response: wt*
* Df Sum Sq Mean Sq F value Pr(>F) *
*treat 1 1.2100 1.2100 5.548 0.03361 **
*Residuals 14 3.0534 0.2181 *
*---*
*Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 *
I want to store only p-value(0.03361) in a file.
Thanks in advance,
Anirban