tstatistics computes either two-sample or paired t-statistics for a bunch of variables measured on the same objects, e.g. genewise t-statistics for a microarray experiment. PermNull uses tstatistics to generate a permutation distribution.
tstatistics(xdat, grp, logse = FALSE, paired = FALSE)
PermNull(xdat, grp, nperm = 100, seed = NULL, logse = FALSE, paired=FALSE)xdat, see Details.tstat and optionally (if logse=TRUE) a second column logse. tstat returns the same number of test statistics as rows in xdat and in the same order, PermNull does the same for consecutive permuations of the grouping variable grp.If the argument seed is specified, PermNull adds an attribute of the same name to the returned data frame.
tstatistics is a fairly fast replacement for function mt.teststat in package multtest, which is written exlusively in R and does not require loading half the Bioconductor infrastructure packages before doing anything. As such, it is used for computing the default test statistics by fdr1d and fdr2d.Note that for the paired test, tstatistics requires the same data structure as mt.teststat: columns belonging to the same pair must be consecutive (though not necessarily in the same order throughout, as grp will indicate the order). The function checks for this and barfs if it does not hold.
PermNull returns the t-statistics and optionally the logarithmized standard errors of the mean for a specified number of permutations.
Both functions are not especially economic in using memory, and collecting the whole set of permutations like PermNull does instead of binning and counting them directly as they come is inherently wasteful.
fdr1d, fdr2d, examples in tMixture