[BioC] Bug Report: mt.teststat with test="pairt"

John Maindonald john.maindonald@anu.edu.au
Thu, 19 Sep 2002 12:09:35 +1000


I am using the function mt.teststat from the multtest package,
version 1.0, date 2002-04-16, as bundled with R1.5.1 for Mac
OSX/X11.

The function mt.teststat(..., test="pairt") insists that
the argument classlabel specify a sequence of (0,1) pairs,
but seems to assume a consistent 0,1 order within those
pairs, irrespective of the setting of classlabel.

>  xy <- matrix(c(12,15,13,16,17,19,3,8,5,13,16,12),byrow=T,ncol=6)
>  xy
      [,1] [,2] [,3] [,4] [,5] [,6]
[1,]   12   15   13   16   17   19
[2,]    3    8    5   13   16   12
>
>  mt.teststat(xy, classlabel=rep(0:1,3), test="pairt")
[1] 8.0000000 0.8320503
>  apply(xy, 1, function(x)t.test(x[c(1,3,5)], x[c(2,4,6)],paired=T)$statistic)
[1] -8.0000000 -0.8320503
>
>  mt.teststat(xy, classlabel=c(0,1,1,0,0,1), test="pairt")
[1] 8.0000000 0.8320503
>  apply(xy, 1, function(x)t.test(x[c(1,4,5)], x[c(2,3,6)],paired=T)$statistic)
[1] -0.3592106  0.6069770

By contrast the setting test="blockf" does take notice of
classlabel:

>  mt.teststat(xy, classlabel=rep(0:1,3), test="blockf")
[1] 64.0000000  0.6923077
>  apply(xy, 1, function(x)t.test(x[c(1,3,5)], 
>x[c(2,4,6)],paired=T)$statistic)^2
[1] 64.0000000  0.6923077
>
>  mt.teststat(xy, classlabel=c(0,1,1,0,0,1), test="blockf")
[1] 0.1290323 0.3684211
>  apply(xy, 1, function(x)t.test(x[c(1,4,5)], 
>x[c(2,3,6)],paired=T)$statistic)^2
[1] 0.1290323 0.3684211

Thus, it seems possible to get the correct t-statistics
by taking the square root of the block F-statistic, and
attaching the correct sign to it!

John Maindonald.

-- 
John Maindonald             email: john.maindonald@anu.edu.au
phone : +61 2 (6125)3473    fax  : +61 2(6125)5549
Centre for Bioinformation Science, Room 1194,
John Dedman Mathematical Sciences Building (Building 27)
Australian National University, Canberra ACT 0200.