bootstrapT: Calculate bootstrap p-values for t statistics

Description Usage Arguments Value Author(s) See Also Examples

View source: R/bootstrapT.R


This function takes a numerical matrix and column indexes for two groups to calculate bootstrapped (by re-sampling) p-values comparing the equality of means from the two groups.


bootstrapT(x, k=20000, obs1, obs2, ...)



numerical matrix to be bootstrapped. The t statistics is calculated by row using the column indexes given by obs1 and obs2 for the two groups tested.


number of bootstrap re-samplings to be done. Defaults to 20000.


logical or numerical column indexes of the first group.


logical or numerical column indexes of the second group.


additional parameters for t.test function from package stats.


The result of this function is a numerical matrix with number of rows given by the rows of the argument x and 3 columns. The first column contain the difference of means between the two groups, the second one contain the original t statistic and the last one gives the bootstrapped p-values, for all rows of the matrix x.


Gustavo H. Esteves <>

See Also

t.test from package stats.


z <- matrix(rnorm(100, 0, 1), 4, 25)
bootstrapT(z, k=100, obs1=1:14, obs2=15:25)

Example output

Loading required package: convert
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,, cbind, colMeans, colSums, colnames,,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax,,
    pmin,, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: limma

Attaching package: 'limma'

The following object is masked from 'package:BiocGenerics':


Loading required package: marray
Loading required package: graph
Doing the boots from 1 up to 500
        meanDif  Statistic P.value
[1,] -0.1842573 -0.4804717    0.52
[2,]  0.1400720  0.4526954    0.61
[3,]  0.2438276  0.6087231    0.57
[4,] -0.5632263 -1.6652172    0.12

maigesPack documentation built on Nov. 8, 2020, 6:23 p.m.