Skip to content
Prev 314913 / 398506 Next

t-test behavior given that the null hypothesis is true

Ah! You have aqssigned a parameter "equal.var=TRUE", and "equal.var"
is not a listed paramater for t.test() -- see ?t.test :

  t.test(x, y = NULL,
    alternative = c("two.sided", "less", "greater"),
    mu = 0, paired = FALSE, var.equal = FALSE,
    conf.level = 0.95, ...)

Try it instead with "var.equal=TRUE", i.e. in your code:
  for(i in 1:k){
    rv.t.pvalues[i] <- t.test(rv[i, 1:(c/2)], rv[i, (c/2+1):c],
  ##equal.var=TRUE, alternative="two.sided")$p.value
    var.equal=TRUE, alternative="two.sided")$p.value
  }

When I run your code with "equal.var", I indeed repeatedly see
the deficient bin for the lowest P-values that you observed.
When I run your code with "var.equal" I do not see it.

The explanation is that, since "equal.var" is not a recognised
parameter for t.test(), it has assumed the default value FALSE
for var.equal, and has therefore (since it is a 2-sample test)
adopted the Welch/Satterthwaite procedure:

  var.equal: a logical variable indicating whether to treat
    the two variances as being equal. If 'TRUE' then the
    pooled variance is used to estimate the variance
    otherwise the Welch (or Satterthwaite) approximation
    to the degrees of freedom is used.

This has the effect of somewhat adapting the test procedure to
the data, so that extreme (i.e. small) values of P are even
rarer than they should be.

With best wishes,
Ted.
On 09-Jan-2013 13:24:59 Pavlos Pavlidis wrote:
-------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at wlandres.net>
Date: 09-Jan-2013  Time: 14:51:04
This message was sent by XFMail