bootstrapT: Calculate bootstrap p-values for t statistics

Description Usage Arguments Value Author(s) See Also Examples

View source: R/bootstrapT.R

Description

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.

Usage

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

Arguments

x

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.

k

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

obs1

logical or numerical column indexes of the first group.

obs2

logical or numerical column indexes of the second group.

...

additional parameters for t.test function from package stats.

Value

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.

Author(s)

Gustavo H. Esteves <gesteves@vision.ime.usp.br>

See Also

t.test from package stats.

Examples

1
2
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,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, 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':

    plotMA

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.