[R] p-values always identical for t.test of certain group of samples, why ?

From: Ng Stanley <stanleyngkl_at_gmail.com>
Date: Tue, 15 Apr 2008 21:31:25 +0800


Hi,

Given the following,

a <- rnorm(5)
b <- rnorm(5)
c <- rnorm(5)
a.1g.scale <- scale(c(a,b,c))[1:5]
b.1g.scale <- scale(c(a,b,c))[6:10]
c.1g.scale <- scale(c(a,b,c))[11:15]
a.2g.scale <- scale(c(a,b))[1:5]
b.2g.scale <- scale(c(a,b))[6:10]
c.2g.scale <- scale(c)
a.3g.scale <- scale(a)

b.3g.scale <- scale(b)
c.3g.scale <- scale(c)

I am puzzled why the p-values are identical for t.test(a.1g.scale, b.1g.scale), t.test(a.2g.scale, b.2g.scale), and t.test(a, b); similarly for t.test(a.3g.scale, b.3g.scale) and t.test(b.3g.scale, c.3g.scale); similarly for t.test(b.1g.scale, c.1g.scale) and t.test(b, c)

> t.test(a.1g.scale, b.1g.scale)$p.value
[1] 0.7462252
> t.test(a.2g.scale, b.2g.scale)$p.value
[1] 0.7462252
> t.test(a.3g.scale, b.3g.scale)$p.value
[1] 1
> t.test(b.1g.scale, c.1g.scale)$p.value
[1] 0.4995508
> t.test(b.2g.scale, c.2g.scale)$p.value
[1] 0.885622
> t.test(b.3g.scale, c.3g.scale)$p.value
[1] 1
> t.test(a, b)$p.value

[1] 0.7462252
> t.test(b, c)$p.value

[1] 0.4995508

        [[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. Received on Tue 15 Apr 2008 - 13:52:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 15 Apr 2008 - 14:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive