Jun Shen
2009-Apr-15 20:29 UTC
[R] How to extract p-value into a table from a groups of t test
Hi,
I have run a groups of t test and obtained a list of the t-test results
(about 30). How do I extract p-values from the 30 t-test results and make a
table output? Thanks
Jun
Example t-test output:
===========================$Lambda_z
Welch Two Sample t-test
data: x[PA1.BS.DN$Onecode == 2] and x[PA1.BS.DN$Onecode == 3]
t = -0.1128, df = 33.635, p-value = 0.9109
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.001918987 0.001717230
sample estimates:
mean of x mean of y
0.004893264 0.004994143
......
--
Jun Shen PhD
PK/PD Scientist
BioPharma Services
Millipore Corporation
15 Research Park Dr.
St Charles, MO 63304
Direct: 636-720-1589
[[alternative HTML version deleted]]
Jorge Ivan Velez
2009-Apr-15 20:50 UTC
[R] How to extract p-value into a table from a groups of t test
Dear Jun, Try this: do.call(c,lapply(your_list_with_the_t_tests,function(x) x$p.value)) HTH, Jorge On Wed, Apr 15, 2009 at 4:29 PM, Jun Shen <jun.shen.ut@gmail.com> wrote:> Hi, > > I have run a groups of t test and obtained a list of the t-test results > (about 30). How do I extract p-values from the 30 t-test results and make a > table output? Thanks > > Jun > > Example t-test output: > ===========================> $Lambda_z > > Welch Two Sample t-test > > data: x[PA1.BS.DN$Onecode == 2] and x[PA1.BS.DN$Onecode == 3] > t = -0.1128, df = 33.635, p-value = 0.9109 > alternative hypothesis: true difference in means is not equal to 0 > 95 percent confidence interval: > -0.001918987 0.001717230 > sample estimates: > mean of x mean of y > 0.004893264 0.004994143 > ...... > > > -- > Jun Shen PhD > PK/PD Scientist > BioPharma Services > Millipore Corporation > 15 Research Park Dr. > St Charles, MO 63304 > Direct: 636-720-1589 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Bert Gunter
2009-Apr-15 20:53 UTC
[R] How to extract p-value into a table from a groups of t test
Everything in R is an object! ?str
z <- t.test(x,y,...)
str(z)
Bert Gunter
Genentech Nonclinical Biostatistics
650-467-7374
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
Behalf Of Jun Shen
Sent: Wednesday, April 15, 2009 1:30 PM
To: r-help at r-project.org
Subject: [R] How to extract p-value into a table from a groups of t test
Hi,
I have run a groups of t test and obtained a list of the t-test results
(about 30). How do I extract p-values from the 30 t-test results and make a
table output? Thanks
Jun
Example t-test output:
===========================$Lambda_z
Welch Two Sample t-test
data: x[PA1.BS.DN$Onecode == 2] and x[PA1.BS.DN$Onecode == 3]
t = -0.1128, df = 33.635, p-value = 0.9109
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-0.001918987 0.001717230
sample estimates:
mean of x mean of y
0.004893264 0.004994143
......
--
Jun Shen PhD
PK/PD Scientist
BioPharma Services
Millipore Corporation
15 Research Park Dr.
St Charles, MO 63304
Direct: 636-720-1589
[[alternative HTML version deleted]]
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.