Skip to content
Prev 314735 / 398502 Next

how to aggregate T-test result in an elegant way?

Thank you?it is really helpful everytime.

I didn't provide any example data because I thought it is just a
question of how to report t.test() result in R.
However,as you say,it is better to show more details for finding an elegant way

In fact  I generate a 3-dimension array like that:
str(a)
 num [1:2, 1:245, 1:3] 47.5 NA 48.9 NA 47.5 ...
 - attr(*, "dimnames")=List of 3
  ..$ : chr [1:2] "13%" "21%"
  ..$ : chr [1:245] "TWF2H101" "TWF2H105" "TWF2H106" "TWF2H110" ...
  ..$ : chr [1:3] "EW.INCU" "EW.17.5" "EMW"

I want to do two sample mean t-test between 13% and 21% for each
variable "EW.INCU" "EW.17.5" "EMW".

So I try these codes:
variable<-dimnames(a)[[3]]
  O2<-dimnames(a)[[1]]
  for (i in variable) {
    print(i)
    print(O2[1])
    print(O2[2])
    print(t.test(a[O2[1],,i],a[O2[2],,i],na.rm=T))
    }

I don't think it is an elegant way and I am inexperience to report raw result.
Could you give me more help?

Yao He

2013/1/7 arun <smartpink111 at yahoo.com>: