Skip to content
Prev 177202 / 398503 Next

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
......