[BioC] rowttests() function in genefilter library

Robert Gentleman rgentlem at fhcrc.org
Wed Nov 25 16:03:59 CET 2009


Hi Paul,


Paul Geeleher wrote:
> Hi,
> 
> I am using this function to perform two sample row t-tests on a matrix:
> 
> rowttests(mat, fac)
> 
> I'm just wondering how the function decides which factor is on which side of
> the t-tests. From what I can see it's based on the order of the factors in
> levels(fac).
> 
> So if levels(fac) is [1] "HER-" "HER+", the function will do a HER-/HER+
> t-test? And positive t-stat indicates a higher mean value in "HER-" (the
> first) group?

   Just look at any row of mat, split by fac
   sp1 = split(mat[1,], fac)
   sapply(sp1, mean)
   and that will tell you the means in each group - from that you can 
easily figure out which way the t-test is being carried out.

> 
> It may sound a stupid question but I'm getting results that completely
> contradict somebody else and I'd like to be 100% sure how the function
> decides this before I go causing trouble!

   the first of these is not as uncommon as it could be -
   you can be 100% sure by doing the t-test by hand (essentially what is 
above)
   you should always be cautious about the third.
   Sample relabling (by you or them) is a common problem - you can't 
easily know if they mislabeled before making it public, or just during 
their analysis etc.  Which is why we very strongly recommend that you 
use and ExpressionSet for your analyses (the names above suggest you are 
not doing that).

    Robert

> 
> Paul.
> 
>



More information about the Bioconductor mailing list