[BioC] multtest/mt.teststat t with equal or unequal variances

Ann Hess hess at stat.colostate.edu
Wed Dec 7 19:39:37 CET 2005


I am using mt.teststat to generate t-statistics assuming equal and 
then unequal variances (to check some results from another calculation). 
Regardless of whether I specify test="t" or test="t.equalvar" I get ther 
same result from mt.test (I believe it is assuming equal variances for 
either option).  Below is the code I used, even checking to make sure the 
variances weren't actually equal.

#RMA.AB is an RMA Expression Set with 12626 genes and 6 samples.  The 
first three columns represent treatment A, the last three columns 
represent treatment B.

> dim(exprs(RMA.AB))
[1] 12626     6
> cl<-c(rep(1,3),rep(0,3))

> teststat1<-mt.teststat(exprs(RMA.AB),cl,test="t")
# should return test statistics based on two-sample Welch t-statistics 
(unequal variances)
> teststat1[1:10]
[1]  2.4102276  1.3967185  1.2955078  1.3675017  1.0794415
[6]  2.1334274  1.1076244 -0.2068253  1.0834689  1.9387467

> teststat2<- mt.teststat(exprs(RMA.AB),cl,test="t.equalvar")
# should return test statistics based on two-sample t-statistics with 
equal variance for the two samples
> teststat2[1:10]
  [1]  2.4102276  1.3967185  1.2955078  1.3675017  1.0794415
  [6]  2.1334274  1.1076244 -0.2068253  1.0834689  1.9387467

> sum(teststat1-teststat2)
  [1] 5.551115e-17
# teststat1=teststat2

#Check var(RMA.A) versus var(RMA.B)
> RMA.A<-exprs(RMA.AB)[,1:3]
> RMA.B<-exprs(RMA.AB)[,4:6]
> var.A<-apply(RMA.A,1,var)
> var.B<-apply(RMA.B,1,var)
> var.A[1:10]
   100_g_at     1000_at     1001_at   1002_f_at   1003_s_at
0.022248140 0.009201980 0.019508012 0.008462727 0.003681282
    1004_at     1005_at     1006_at   1007_s_at   1008_f_at
  0.018467891 0.016931126 0.010809741 0.018222501 0.026152638
> var.B[1:10]
    100_g_at     1000_at     1001_at   1002_f_at   1003_s_at
0.017586464 0.010112982 0.059191673 0.030372182 0.023888130
     1004_at     1005_at     1006_at   1007_s_at   1008_f_at
0.014180197 0.014445595 0.009923636 0.012814546 0.008584633
#So, var(RMA.A) is  not equal to var(RMA.B)

Why are they returning the same result and how can I get the t-statistic 
assuming  UNEQUAL variances?

Thanks.

Ann



More information about the Bioconductor mailing list