This is the kind of thing that rowMeans was made for.
For the numerator of the t statistic:
x1 - temp.matrix[,1:11]
x2 - temp.matrix[,12:22]
numerator - rowMeans(x1) - rowMeans(x2)
For the denominator, if you're using S+ you can use rowVars;
in R you can program a simple version quickly, e.g.
Hello all,
I am trying to run a two sample t-test on a matrix which is a
196002*22 matrix. I want to run the t-test, row-wise, with the
first 11 columns being a part of the first group and columns
12-22 being a part of the second group.
I tried running something like (temp.matrix being my
Here's one suggestion: convert the matrix into a three-dimensional array and
use apply on it.
Ranjan
On Thu, 1 Mar 2007 11:51:29 -0600 (CST) Nameeta Lobo [EMAIL PROTECTED] wrote:
Hello all,
I am trying to run a two sample t-test on a matrix which is a
196002*22 matrix. I want to run the
I'd suggest to use the function mt.teststat in the package multtest or
rowttests in the package genefilter. Both can be found athe the bioconductor
webpage (www.bioconductor.org)
Stef
On Thu, Mar 01, 2007 at 12:48:29PM -0600, Ranjan Maitra wrote:
RanjanHere's one suggestion: convert the
Ranjan Maitra napsal(a):
Here's one suggestion: convert the matrix into a three-dimensional array and
use apply on it.
Converting to 3 dims should not be neccessary:
m - matrix(rnorm(110),ncol=22)
t.list - apply(m,1,function(x){t.test(x[1:11],x[12:22],paired=TRUE)})
However, I have no idea