matrixT {ClassComparison} | R Documentation |
Utility functions for computing vectors of row-by-row means, variances, and t-statistics.
matrixMean(x) matrixVar(x, xmean) matrixT(m, v)
x |
a matrix |
xmean |
a numeric vector or single-column matrix |
m |
a matrix |
v |
a logical vector of length equal to the number of columns of m |
matrixMean
returns a single-column matrix containing the
row-by-row means of x
.
matrixVar
returns a single-column matrix containing the
row-by-row means of x
, assuming that xmean
contains the
corresponding mean values.
matrixT
returns a single-column matrix of t-statistics from a
two-sample t-test comparing the columns for which v
is true to
those for which v
is false.
Kevin R. Coombes <kcoombes@mdanderson.org>
ng <- 1000 ns <- 50 dat <- matrix(rnorm(ng*ns), ncol=ns) clas <- factor(rep(c('Good', 'Bad'), each=25)) myMean <- matrixMean(dat) myVar <- matrixVar(dat, myMean) plot(myMean, myVar) myT <- matrixT(dat, clas) hist(myT) rm(ng, ns, dat, myMean, myVar, myT)