rowFtests {arrayMagic}R Documentation

F-test and t-test for rows of a matrix

Description

F-test and t-test for rows of a matrix

Usage

rowFtests(x, fac)
rowttests(x, fac)

Arguments

x Matrix
fac Factor, with length(fac)=ncol(x). For rowttests, fac must have exactly two levels.

Value

A list with the test statistics, p-values, degrees of freedom.

Author(s)

Wolfgang Huber <w.huber@dkfz.de>

See Also

mt.teststat

Examples

   x  = matrix(runif(1e5), ncol=100)
   k2 = floor(runif(ncol(x))*2)
   k7 = floor(runif(ncol(x))*7)

   tt = rowttests(x, factor(k2))
   ft = rowFtests(x, factor(k7))

   if(require(multtest)) {
     fs = mt.teststat(x, k7, test="f")
     stopifnot(all(abs(fs - ft$statistic) < 1e-6))

     ts = mt.teststat(x, k2, test="t.equalvar")
     stopifnot(all(abs(ts - tt$statistic) < 1e-6))
   }

[Package Contents]