Skip to content

Discrepancy with p.value from t.test

3 messages · Jonathan Thayn, Peter Langfelder, Albyn Jones

#
On Tue, Nov 1, 2011 at 12:40 PM, Jonathan Thayn <jthayn at ilstu.edu> wrote:
If you read the output of t.test carefully, you will find something like

p-value < 2.2e-16

not

p-value = 2.2e-16

so the results are not inconsistent. Not sure why t.test is coded that
way, perhaps the p-value calculation is not very reliable below
roughly 2e-16. This issue could also come up if the function doesn't
use lower/upper tail of the distribution function as needed and then
must subtract the calculated results from 1 to obtain the returned
value.

Here's an example:
Welch Two Sample t-test

data:  x by y
t = 12.9463, df = 97.424, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 1.397253 1.903200
sample estimates:
mean in group FALSE  mean in group TRUE
          0.7596083          -0.8906181

Now do a naive pt:
[1] 1

my desired p-value is 1-pt(12.9463,  df = 97.424) but that's zero. Of
course, I can get the p-value in a more intelligent way,
[1] 3.394337e-23


Peter
#
The print method is the issue:
[1] 4.108001e-38
t 
-15.93656 

albyn
On Tue, Nov 01, 2011 at 02:40:15PM -0500, Jonathan Thayn wrote: