Non-parametric bootstrap resampling function in package ‘multtest’
Given a data set and a closure, which consists of a function for computing the test statistic and its enclosing environment, this function produces a non-parametric bootstrap estimated test statistics null distribution. The observations in the data are resampled using the ordinary non-parametric bootstrap is used to produce an estimated test statistics distribution. This distribution is then transformed to produce the null distribution. Options for transforming the nonparametric bootstrap distribution include center.only
, center.scale
, and quant.trans
. Details are given below. These functions are called by MTP
and EBMTP
.
boot.null(X, label, stat.closure, W = NULL, B = 1000, test, nulldist, theta0 = 0, tau0 = 1, marg.null = NULL, marg.par = NULL, ncp = 0, perm.mat, alternative = "two.sided", seed = NULL, cluster = 1, dispatch = 0.05, keep.nulldist, keep.rawdist) boot.resample(X, label, p, n, stat.closure, W, B, test) center.only(muboot, theta0, alternative) center.scale(muboot, theta0, tau0, alternative) quant.trans(muboot, marg.null, marg.par, ncp, alternative, perm.mat)
X |
A matrix, data.frame or ExpressionSet containing the raw data. In the case of an ExpressionSet, |
label |
A vector containing the class labels for t- and F-tests. |
stat.closure |
A closure for test statistic computation, like those produced internally by the |
W |
A vector or matrix containing non-negative weights to be used in computing the test statistics. If a matrix, |
B |
The number of bootstrap iterations (i.e. how many resampled data sets) or the number of permutations (if |
test |
Character string specifying the test statistics to use. See |
theta0 |
The value used to center the test statistics. For tests based on a form of t-statistics, this should be zero (default). For F-tests, this should be 1. |
tau0 |
The value used to scale the test statistics. For tests based on a form of t-statistics, this should be 1 (default). For F-tests, this should be 2/(K-1), where K is the number of groups. This argument is missing when |
marg.null |
If |
marg.par |
If |
ncp |
If |
perm.mat |
If |
alternative |
Character string indicating the alternative hypotheses, by default 'two.sided'. For one-sided tests, use 'less' or 'greater' for null hypotheses of 'greater than or equal' (i.e. alternative is 'less') and 'less than or equal', respectively. |
seed |
Integer or vector of integers to be used as argument to |
cluster |
Integer of 1 or a cluster object created through the package snow. With cluster=1, bootstrap is implemented on single node. Supplying a cluster object results in the bootstrap being implemented in parallel on the provided nodes. This option is only available for the bootstrap procedure. |
csnull |
DEPRECATED as of |
dispatch |
The number or percentage of bootstrap iterations to dispatch at a time to each node of the cluster if a computer cluster is used. If dispatch is a percentage, |
p |
An integer of the number of variables of interest to be tested. |
n |
An integer of the total number of samples. |
muboot |
A matrix of bootstrapped test statistics. |
keep.nulldist |
Logical indicating whether to return the computed bootstrap null distribution, by default 'TRUE'. Not available for |
keep.rawdist |
Logical indicating whether to return the computed non-null (raw) bootstrap distribution, by default 'FALSE'. Not available for when using |
A list with the following elements:
rawboot |
If |
muboot |
If Both list elements For
The above defaults, however, can be overridden by manually setting values of The |
Thank you to Duncan Temple Lang and Peter Dimitrov for suggestions about the code.
Katherine S. Pollard, Houston N. Gilbert, and Sandra Taylor, with design contributions from Sandrine Dudoit and Mark J. van der Laan.
M.J. van der Laan, S. Dudoit, K.S. Pollard (2004), Augmentation Procedures for Control of the Generalized Family-Wise Error Rate and Tail Probabilities for the Proportion of False Positives, Statistical Applications in Genetics and Molecular Biology, 3(1). http://www.bepress.com/sagmb/vol3/iss1/art15/
M.J. van der Laan, S. Dudoit, K.S. Pollard (2004), Multiple Testing. Part II. Step-Down Procedures for Control of the Family-Wise Error Rate, Statistical Applications in Genetics and Molecular Biology, 3(1). http://www.bepress.com/sagmb/vol3/iss1/art14/
S. Dudoit, M.J. van der Laan, K.S. Pollard (2004), Multiple Testing. Part I. Single-Step Procedures for Control of General Type I Error Rates, Statistical Applications in Genetics and Molecular Biology, 3(1). http://www.bepress.com/sagmb/vol3/iss1/art13/
Katherine S. Pollard and Mark J. van der Laan, "Resampling-based Multiple Testing: Asymptotic Control of Type I Error and Applications to Gene Expression Data" (June 24, 2003). U.C. Berkeley Division of Biostatistics Working Paper Series. Working Paper 121. http://www.bepress.com/ucbbiostat/paper121
M.J. van der Laan and A.E. Hubbard (2006), Quantile-function Based Null Distributions in Resampling Based Multiple Testing, Statistical Applications in Genetics and Molecular Biology, 5(1). http://www.bepress.com/sagmb/vol5/iss1/art14/
S. Dudoit and M.J. van der Laan. Multiple Testing Procedures and Applications to Genomics. Springer Series in Statistics. Springer, New York, 2008.
set.seed(99) data<-matrix(rnorm(90),nr=9) #closure ttest<-meanX(psi0=0,na.rm=TRUE,standardize=TRUE,alternative="two.sided",robust=FALSE) #test statistics obs<-get.Tn(X=data,stat.closure=ttest,W=NULL) #bootstrap null distribution (B=100 for speed, default nulldist, "boot.cs") nulldistn<-boot.null(X=data,W=NULL,stat.closure=ttest,B=100,test="t.onesamp", nulldist="boot.cs",theta0=0,tau0=1,alternative="two.sided", keep.nulldist=TRUE,keep.rawdist=FALSE)$muboot #bootstrap null distribution with marginal quantile transformation showing #default values that are passed to marg.null and marg.par arguments nulldistn.qt<-boot.null(X=data,W=NULL,stat.closure=ttest,B=100,test="t.onesamp", nulldist="boot.qt",theta0=0,tau0=1,alternative="two.sided", keep.nulldist=TRUE,keep.rawdist=FALSE,marg.null="t", marg.par=matrix(9,nr=10,nc=1))$muboot #unadjusted p-values rawp<-apply((obs[1,]/obs[2,])<=nulldistn,1,mean) sum(rawp<=0.01) rawp.qt<-apply((obs[1,]/obs[2,])<=nulldistn.qt,1,mean) sum(rawp.qt<=0.01)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.