Title: | FWER and FDR Controlling Procedures for Multiple Correlation Tests |
---|---|
Description: | Different multiple testing procedures for correlation tests are implemented. These procedures were shown to theoretically control asymptotically the Family Wise Error Rate (Roux (2018) <https://tel.archives-ouvertes.fr/tel-01971574v1>) or the False Discovery Rate (Cai & Liu (2016) <doi:10.1080/01621459.2014.999157>). The package gather four test statistics used in correlation testing, four FWER procedures with either single step or stepdown versions, and four FDR procedures. |
Authors: | Gannaz Irene [aut, cre] |
Maintainer: | Gannaz Irene <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.0.2.2 |
Built: | 2024-12-11 07:01:23 UTC |
Source: | CRAN |
The package compiles some multiple testing procedures which theoretically control asymptotically the FWER in the framework of correlation testing.
Four tests statistics can be considered: the empirical correlation, the Student statistics, the Fisher's z-transform and the usual Gaussian statistics considering random variables .
Four methods are implemented: Bonferroni (1935)'s, Šidák (1967)'s, Romano & Wolf (2005)'s bootstrap and (Drton & Perlman (2007)'s procedure based on the asymptotic distributions of the test statistics, called MaxTinfty.
The package also includes some multiple testing procedures which are related to the control of the FDR : Cai & Liu (2016)'s procedures called LCT-N and LCT-B -which have been proven to control the FDR for correlation tests- and Benjamini & Hochberg (1995)'s -which has no theoretical results in correlation testing.
Consider a set of
independent and identically distributed
-valued random variables. Denote
data
the array containing , with observation indexes
in row. The aim is to test simultaneously
Four tests statistics are implemented: the empirical correlation, the Student statistics, the Fisher's z-transform and the usual test statistics on expectancy considering the product of random variables. They are available in function eval_stat
.
Next, two main types of procedures are available:
Bonferroni (1935)'s method, Šidák (1967)'s procedure, Romano & Wolf (2005)'s bootstrap procedure and Drton & Perlman (2007)'s procedure. A description of these methods can be found in Chapter 5 of Roux (2018). To apply these procedures, function ApplyFwerCor
can be used as follows:
ApplyFwerCor(data,alpha,stat_test,method)
, with alpha
the desired level of control for FDR and stat_test
, method
respectively the kind of test statistic and the FDR controlling method. The function returns the list of indexes for which null hypothesis
is rejected.
Cai & Liu(2016)'s two procedures and Benjamini & Hochberg (1995)'s procedure (with no theoretical proof for the latest). To apply these procedures, use function ApplyFdrCor
as follows:
ApplyFdrCor(data,alpha,stat_test,method)
with alpha
the desired level of control for FWER and stat_test
, method
respectively the kind of test statistic and the FDR controlling method. The function returns the list of indexes for which null hypothesis
is rejected.
Functions SimuFwer
and SimuFdr
provide simulations of Gaussian random variables for a given correlation matrix and return estimated FWER, FDR, Power and true discovery rate obtained applying one of the procedure above. Some example of results obtained can be found in Chapter 6 of Roux (2018).
Irene Gannaz
Maintainer: Irene Gannaz <[email protected]>
Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the royal statistical society. Series B (Methodological), 289-300, https://doi.org/10.1111/j.2517-6161.1995.tb02031.x.
Bonferroni, C. E. (1935). Il calcolo delle assicurazioni su gruppi di teste. Studi in onore del professore salvatore ortu carboni, 13-60.
Cai, T. T., & Liu, W. (2016). Large-scale multiple testing of correlations. Journal of the American Statistical Association, 111(513), 229-240, https://doi.org/10.1080/01621459.2014.999157.
Drton, M., & Perlman, M. D. (2007). Multiple testing and error control in Gaussian graphical model selection. Statistical Science, 22(3), 430-449, https://doi.org/10.1214/088342307000000113.
Romano, J. P., & Wolf, M. (2005). Exact and approximate stepdown methods for multiple hypothesis testing. Journal of the American Statistical Association, 100(469), 94-108, https://doi.org/10.1198/016214504000000539.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
Šidák, Z. (1967). Rectangular confidence regions for the means of multivariate normal distributions. Journal of the American Statistical Association, 62(318), 626-633.
# Parameters for simulations Nsimu <- 100 # number of Monte-Carlo simulations seqn <- seq(100,400,100) # sample sizes p <- 10 # number of random variables considered rho <- 0.3 # value of non-zero correlations seed <- 156724 corr_theo <- diag(1,p) # the correlation matrix corr_theo[1,2:p] <- rho corr_theo[2:p,1] <- rho # Parameters for multiple testing procedure stat_test <- 'empirical' # test statistics for correlation tests method <- 'BootRW' # FWER controlling procedure SD <- FALSE # logical determining if stepdown is applied alpha <- 0.05 # FWER threshold Nboot <- 100 # number of bootstrap or simulated samples # Simulations and application of the chosen procedure res <- matrix(0,nrow=length(seqn),ncol=5) for(i in 1:length(seqn)){ temp <- SimuFwer(corr_theo,n=seqn[i],Nsimu=Nsimu,alpha=alpha,stat_test=stat_test, method='BootRW',Nboot=Nboot,stepdown=SD,seed=seed) res[i,] <- temp } rownames(res) <- seqn colnames(res) <- names(temp) # Display results par(mfrow=c(1,2)) plot(seqn,res[,'fwer'],type='b',ylim=c(0,max(alpha*1.1,max(res[,'fwer']))), main='FWER',ylab='fwer',xlab='number of observations') plot(seqn,res[,'sensitivity'],type='b',ylim=c(0,1.1), main='Power',ylab='sensitivity',xlab='number of observations')
# Parameters for simulations Nsimu <- 100 # number of Monte-Carlo simulations seqn <- seq(100,400,100) # sample sizes p <- 10 # number of random variables considered rho <- 0.3 # value of non-zero correlations seed <- 156724 corr_theo <- diag(1,p) # the correlation matrix corr_theo[1,2:p] <- rho corr_theo[2:p,1] <- rho # Parameters for multiple testing procedure stat_test <- 'empirical' # test statistics for correlation tests method <- 'BootRW' # FWER controlling procedure SD <- FALSE # logical determining if stepdown is applied alpha <- 0.05 # FWER threshold Nboot <- 100 # number of bootstrap or simulated samples # Simulations and application of the chosen procedure res <- matrix(0,nrow=length(seqn),ncol=5) for(i in 1:length(seqn)){ temp <- SimuFwer(corr_theo,n=seqn[i],Nsimu=Nsimu,alpha=alpha,stat_test=stat_test, method='BootRW',Nboot=Nboot,stepdown=SD,seed=seed) res[i,] <- temp } rownames(res) <- seqn colnames(res) <- names(temp) # Display results par(mfrow=c(1,2)) plot(seqn,res[,'fwer'],type='b',ylim=c(0,max(alpha*1.1,max(res[,'fwer']))), main='FWER',ylab='fwer',xlab='number of observations') plot(seqn,res[,'sensitivity'],type='b',ylim=c(0,1.1), main='Power',ylab='sensitivity',xlab='number of observations')
Applies multiple testing procedures built to control (asymptotically) the FDR for correlation testing. Some have no theoretical proofs for tests on a correlation matrix.
ApplyFdrCor( data, alpha = 0.05, stat_test = "empirical", method = "LCTnorm", Nboot = 1000, vect = FALSE, arr.ind = FALSE )
ApplyFdrCor( data, alpha = 0.05, stat_test = "empirical", method = "LCTnorm", Nboot = 1000, vect = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
|
method |
choice between 'LCTnorm' and 'LCTboot' developped by Cai & Liu (2016), 'BH', traditional Benjamini-Hochberg's procedure Benjamini & Hochberg (1995)'s and 'BHboot', Benjamini-Hochberg (1995)'s procedure with bootstrap evaluation of p-values |
Nboot |
number of iterations for bootstrap p-values evaluation |
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with repspect to level alpha |
Returns either
logicals indicating if the corresponding correlation is significant, as a vector or a matrix depending on vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the royal statistical society. Series B (Methodological), 289-300.
Cai, T. T., & Liu, W. (2016). Large-scale multiple testing of correlations. Journal of the American Statistical Association, 111(513), 229-240.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor
LCTnorm, LCTboot, BHCor, BHBootCor
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) res <- ApplyFdrCor(data,stat_test='empirical',method='LCTnorm') # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) res <- ApplyFdrCor(data,stat_test='empirical',method='LCTnorm') # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)
Applies multiple testing procedures controlling (asymptotically) the FWER for tests on a correlation matrix. Methods are described in Chapter 5 of Roux (2018).
ApplyFwerCor( data, alpha = NULL, stat_test = "empirical", method = "Sidak", Nboot = 1000, stepdown = TRUE, vect = FALSE, logical = stepdown, arr.ind = FALSE )
ApplyFwerCor( data, alpha = NULL, stat_test = "empirical", method = "Sidak", Nboot = 1000, stepdown = TRUE, vect = FALSE, logical = stepdown, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing (used if logical=TRUE) |
stat_test |
|
method |
choice between 'Bonferroni', 'Sidak', 'BootRW', 'MaxTinfty' |
Nboot |
number of iterations for Monte-Carlo of bootstrap quantile evaluation |
stepdown |
logical, if TRUE a stepdown procedure is applied |
vect |
if TRUE returns a vector of adjusted p-values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected
if |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with repspect to level alpha |
Returns either
the adjusted p-values, as a vector or a matrix, depending on vect
logicals indicating if the corresponding correlation is significant if logical=TRUE
, as a vector or a matrix depending on vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Bonferroni, C. E. (1935). Il calcolo delle assicurazioni su gruppi di teste. Studi in onore del professore salvatore ortu carboni, 13-60.
Drton, M., & Perlman, M. D. (2007). Multiple testing and error control in Gaussian graphical model selection. Statistical Science, 22(3), 430-449.
Romano, J. P., & Wolf, M. (2005). Exact and approximate stepdown methods for multiple hypothesis testing. Journal of the American Statistical Association, 100(469), 94-108.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
Šidák, Z. (1967). Rectangular confidence regions for the means of multivariate normal distributions. Journal of the American Statistical Association, 62(318), 626-633.
ApplyFwerCor_SD, ApplyFdrCor
BonferroniCor, SidakCor, BootRWCor, maxTinftyCor
BonferroniCor_SD, SidakCor_SD, BootRWCor_SD, maxTinftyCor_SD
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values (res <- ApplyFwerCor(data,stat_test='empirical',method='Bonferroni',stepdown=FALSE)) # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values (res <- ApplyFwerCor(data,stat_test='empirical',method='Bonferroni',stepdown=FALSE)) # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)
Applies oracle MaxTinfty procedure described in Drton & Perlman (2007) which controls asymptotically the FWER for tests on a correlation matrix. It needs the true correlation matrix.
ApplyFwerCor_oracle( data, corr_theo, alpha = c(), stat_test = "empirical", method = "MaxTinfty", Nboot = 1000, stepdown = TRUE, vect = FALSE, logical = stepdown, arr.ind = FALSE )
ApplyFwerCor_oracle( data, corr_theo, alpha = c(), stat_test = "empirical", method = "MaxTinfty", Nboot = 1000, stepdown = TRUE, vect = FALSE, logical = stepdown, arr.ind = FALSE )
data |
matrix of observations |
corr_theo |
true matrix of correlations |
alpha |
level of multiple testing (used if logical=TRUE) |
stat_test |
|
method |
only 'MaxTinfty' implemented |
Nboot |
number of iterations for Monte-Carlo of bootstrap quantile evaluation |
stepdown |
logical, if TRUE a stepdown procedure is applied |
vect |
if TRUE returns a vector of adjusted p-values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected
if |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with repspect to level alpha |
Returns either
the adjusted p-values, as a vector or a matrix, depending on vect
(unavailable with stepdown)
logicals indicating if the corresponding correlation is significant if logical=TRUE
, as a vector or a matrix depending on vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Oracle estimation of the quantile is used, based on the true correlation matrix
Drton, M., & Perlman, M. D. (2007). Multiple testing and error control in Gaussian graphical model selection. Statistical Science, 22(3), 430-449.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor
maxTinftyCor, maxTinftyCor_SD
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values: (res <- ApplyFwerCor_oracle(data,corr_theo,stat_test='empirical',Nboot=1000,stepdown=FALSE)) # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values: (res <- ApplyFwerCor_oracle(data,corr_theo,stat_test='empirical',Nboot=1000,stepdown=FALSE)) # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)
Benjamini & Hochberg (1995)'s procedure on the correlation matrix entries with bootstrap evaluation of p-values (no theoretical proof of control).
BHBootCor( data, alpha = 0.05, stat_test = "2nd.order", Nboot = 100, vect = FALSE, arr.ind = FALSE )
BHBootCor( data, alpha = 0.05, stat_test = "2nd.order", Nboot = 100, vect = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
|
Nboot |
number of iterations for bootstrap quantile evaluation |
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
a vector or a matrix of logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, if arr.ind=FALSE
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the royal statistical society. Series B (Methodological), 289-300.
ApplyFdrCor, BHCor
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BHBootCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BHBootCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
Benjamini & Hochberg (1995)'s procedure on the correlation matrix entries (no theoretical proof of control).
BHCor( data, alpha = 0.05, stat_test = "2nd.order", vect = FALSE, arr.ind = FALSE )
BHCor( data, alpha = 0.05, stat_test = "2nd.order", vect = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
|
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to vectorize(cor(data)) if FALSE, returns an array containing TRUE/FALSE values for each entry of the correlation matrix |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the royal statistical society. Series B (Methodological), 289-300.
ApplyFdrCor, BHBootCor
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BHCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BHCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
Bonferroni multiple testing procedure for correlations.
BonferroniCor( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = FALSE, arr.ind = FALSE )
BonferroniCor( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing (used if logical=TRUE) |
stat_test |
|
vect |
if TRUE returns a vector of adjusted p-values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
the adjusted p-values, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Bonferroni, C. E. (1935). Il calcolo delle assicurazioni su gruppi di teste. Studi in onore del professore salvatore ortu carboni, 13-60.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor, BonferroniCor_SD
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 corr_theo <- diag(1,p) data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- BonferroniCor(data,stat_test='empirical') round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly BonferroniCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 corr_theo <- diag(1,p) data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- BonferroniCor(data,stat_test='empirical') round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly BonferroniCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
Bonferroni multiple testing method for correlations with stepdown procedure.
BonferroniCor_SD( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = TRUE, arr.ind = FALSE )
BonferroniCor_SD( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = TRUE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
4 test statistics are available:
|
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected
if FALSE, returns a list of successive p-values : element [[i+1]] of the list giving the p-values evaluated on the non-rejected hypothesis at step [[i]]; p-values are either as a vector or a list depending on |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Bonferroni, C. E. (1935). Il calcolo delle assicurazioni su gruppi di teste. Studi in onore del professore salvatore ortu carboni, 13-60.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor, BonferroniCor
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BonferroniCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- BonferroniCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BonferroniCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- BonferroniCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
Multiple testing method based on the evaluation of quantile by bootstrap in the initial dataset (Romano & Wolf (2005)).
BootRWCor( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, vect = FALSE, logical = FALSE, arr.ind = FALSE )
BootRWCor( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, vect = FALSE, logical = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing (used if logical=TRUE) |
stat_test |
|
Nboot |
number of iterations for Monte-Carlo quantile evaluation |
vect |
if TRUE returns a vector of adjusted p-values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
the adjusted p-values, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Romano, J. P., & Wolf, M. (2005). Exact and approximate stepdown methods for multiple hypothesis testing. Journal of the American Statistical Association, 100(469), 94-108.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor, BootRWCor_SD
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- BootRWCor(data,stat_test='empirical',Nboot=1000) round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly BootRWCor(data,alpha,stat_test='empirical',Nboot=1000,arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- BootRWCor(data,stat_test='empirical',Nboot=1000) round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly BootRWCor(data,alpha,stat_test='empirical',Nboot=1000,arr.ind=TRUE)
Multiple testing method based on the evaluation of quantile by bootstrap in the initial dataset (Romano & Wolf (2005)), with stepdown procedure.
BootRWCor_SD( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, vect = FALSE, logical = TRUE, arr.ind = FALSE )
BootRWCor_SD( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, vect = FALSE, logical = TRUE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
4 test statistics are available:
|
Nboot |
number of iterations for Bootstrap quantile evaluation |
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected
if FALSE, returns a list of successive p-values : element [[i+1]] of the list giving the p-values evaluated on the non-rejected hypothesis at step [[i]]; p-values are either as a vector or a list depending on |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Romano, J. P., & Wolf, M. (2005). Exact and approximate stepdown methods for multiple hypothesis testing. Journal of the American Statistical Association, 100(469), 94-108.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor, BootRWCor
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BootRWCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- BootRWCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: BootRWCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- BootRWCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
Returns the theoretical covariance of empirical correlations.
covD2nd(r)
covD2nd(r)
r |
a correlation matrix |
Returns the theoretical covariance of 2nd order statistics,
with
.
covDcor
p <- 10 corr_theo <- diag(1,p) corr_theo[2:p,] <- 0.3 corr_theo[,2:p] <- 0.3 covD2nd(corr_theo)
p <- 10 corr_theo <- diag(1,p) corr_theo[2:p,] <- 0.3 corr_theo[,2:p] <- 0.3 covD2nd(corr_theo)
Returns the theoretical covariance of empirical correlations.
covDcor(r)
covDcor(r)
r |
a correlation matrix |
Returns the theoretical covariance of empirical correlations.
Aitkin, M. A. (1969). Some tests for correlation matrices. Biometrika, 443-446.
covDcorNorm
p <- 10 corr_theo <- diag(1,p) corr_theo[2:p,] <- 0.3 corr_theo[,2:p] <- 0.3 covDcor(corr_theo)
p <- 10 corr_theo <- diag(1,p) corr_theo[2:p,] <- 0.3 corr_theo[,2:p] <- 0.3 covDcor(corr_theo)
Returns the theoretical covariance of test statistics for correlation testing.
covDcorNorm(cor_mat, stat_test = "empirical")
covDcorNorm(cor_mat, stat_test = "empirical")
cor_mat |
A correlation matrix |
stat_test |
|
Returns the theoretical covariance of the test statistics.
covDcor, covD2nd, eval_stat
p <- 10 corr_theo <- diag(1,p) corr_theo[2:p,] <- 0.3 corr_theo[,2:p] <- 0.3 covDcorNorm(corr_theo,stat_test='student')
p <- 10 corr_theo <- diag(1,p) corr_theo[2:p,] <- 0.3 corr_theo[,2:p] <- 0.3 covDcorNorm(corr_theo,stat_test='student')
Evaluates the test statistics for tests on correlation matrix entries.
eval_stat(data, type = "empirical")
eval_stat(data, type = "empirical")
data |
matrix of observations |
type |
|
Returns the test statistics for correlation testing.
n <- 100 p <- 10 corr_theo <- diag(1,p) data <- MASS::mvrnorm(n,rep(0,p),corr_theo) stat <- eval_stat(data,'fisher')
n <- 100 p <- 10 corr_theo <- diag(1,p) data <- MASS::mvrnorm(n,rep(0,p),corr_theo) stat <- eval_stat(data,'fisher')
Bootstrap procedure LCT-B proposed by Cai & Liu (2016) for correlation testing.
LCTboot( data, alpha = 0.05, stat_test = "2nd.order", Nboot = 100, vect = FALSE, arr.ind = FALSE )
LCTboot( data, alpha = 0.05, stat_test = "2nd.order", Nboot = 100, vect = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
|
Nboot |
number of iterations for bootstrap quantile evaluation |
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Cai, T. T., & Liu, W. (2016). Large-scale multiple testing of correlations. Journal of the American Statistical Association, 111(513), 229-240.
ApplyFdrCor, LCTNorm
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: LCTboot(data,alpha,stat_test='empirical',Nboot=100,arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: LCTboot(data,alpha,stat_test='empirical',Nboot=100,arr.ind=TRUE)
Procedure LCT-N proposed by Cai & Liu (2016) for correlation testing.
LCTnorm( data, alpha = 0.05, stat_test = "2nd.order", vect = FALSE, arr.ind = FALSE )
LCTnorm( data, alpha = 0.05, stat_test = "2nd.order", vect = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
|
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Cai, T. T., & Liu, W. (2016). Large-scale multiple testing of correlations. Journal of the American Statistical Association, 111(513), 229-240.
ApplyFdrCor, LCTboot
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: LCTnorm(data,alpha,stat_test='empirical',arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: LCTnorm(data,alpha,stat_test='empirical',arr.ind=TRUE)
Multiple testing method based on the evaluation of quantile by simulation of observations from the asymptotic distribution (Drton & Perlman (2007)).
maxTinftyCor( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, OmegaChap = covDcorNorm(cor(data), stat_test), vect = FALSE, logical = FALSE, arr.ind = FALSE )
maxTinftyCor( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, OmegaChap = covDcorNorm(cor(data), stat_test), vect = FALSE, logical = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing (used if logical=TRUE) |
stat_test |
|
Nboot |
number of iterations for Monte-Carlo quantile evaluation |
OmegaChap |
matrix of covariance of empirical correlations used for quantile evaluation; optional, useful for oracle estimation and step-down |
vect |
if TRUE returns a vector of adjusted p-values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
the adjusted p-values, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Drton, M., & Perlman, M. D. (2007). Multiple testing and error control in Gaussian graphical model selection. Statistical Science, 22(3), 430-449.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor, maxTinftyCor_SD
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- maxTinftyCor(data,stat_test='empirical',Nboot=1000) round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly res <- maxTinftyCor(data,alpha,stat_test='empirical',Nboot=1000,arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- maxTinftyCor(data,stat_test='empirical',Nboot=1000) round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly res <- maxTinftyCor(data,alpha,stat_test='empirical',Nboot=1000,arr.ind=TRUE)
Multiple testing method based on the evaluation of quantile by simulation of observations from the asymptotic distribution (Drton & Perlman (2007)), with stepdown procedure.
maxTinftyCor_SD( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, OmegaChap = covDcorNorm(cor(data), stat_test), vect = FALSE, logical = TRUE, arr.ind = FALSE )
maxTinftyCor_SD( data, alpha = 0.05, stat_test = "empirical", Nboot = 1000, OmegaChap = covDcorNorm(cor(data), stat_test), vect = FALSE, logical = TRUE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
4 test statistics are available:
|
Nboot |
number of iterations for Monte-Carlo quantile evaluation |
OmegaChap |
matrix of covariance of test statistics; optional, useful for oracle estimation and step-down |
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected
if FALSE, returns a list of successive p-values : element [[i+1]] of the list giving the p-values evaluated on the non-rejected hypothesis at step [[i]]; p-values are either as a vector or a list depending on |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Drton, M., & Perlman, M. D. (2007). Multiple testing and error control in Gaussian graphical model selection. Statistical Science, 22(3), 430-449.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor, maxTinftyCor
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: maxTinftyCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- maxTinftyCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: maxTinftyCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- maxTinftyCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
Sidak multiple testing procedure for correlations.
SidakCor( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = FALSE, arr.ind = FALSE )
SidakCor( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing (used if logical=TRUE) |
stat_test |
|
vect |
if TRUE returns a vector of adjusted p-values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
the adjusted p-values, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
Šidák, Z. (1967). Rectangular confidence regions for the means of multivariate normal distributions. Journal of the American Statistical Association, 62(318), 626-633.
ApplyFwerCor, SidakCor_SD
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- SidakCor(data,stat_test='empirical') round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly SidakCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # adjusted p-values res <- SidakCor(data,stat_test='empirical') round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly SidakCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
Sidak multiple testing method for correlations with stepdown procedure.
SidakCor_SD( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = TRUE, arr.ind = FALSE )
SidakCor_SD( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = TRUE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing |
stat_test |
4 test statistics are available:
|
vect |
if TRUE returns a vector of TRUE/FALSE values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected
if FALSE, returns a list of successive p-values : element [[i+1]] of the list giving the p-values evaluated on the non-rejected hypothesis at step [[i]]; p-values are either as a vector or a list depending on |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
logicals, equal to TRUE if the corresponding element of the statistic vector is rejected, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
Šidák, Z. (1967). Rectangular confidence regions for the means of multivariate normal distributions. Journal of the American Statistical Association, 62(318), 626-633.
ApplyFwerCor, SidakCor
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: SidakCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- SidakCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) alpha <- 0.05 # significant correlations: SidakCor_SD(data,alpha,stat_test='empirical', arr.ind=TRUE) # successive p-values res <- SidakCor_SD(data,stat_test='empirical', logical=FALSE) lapply(res,FUN=function(x){round(x,2)}) # succesive rejections lapply(res,FUN=function(x){whichCor(x<alpha)})
Simulates Gaussian data with a given correlation matrix and applies a FDR controlling procedure on the correlations.
SimuFdr( corr_theo, n = 100, Nsimu = 1, alpha = 0.05, stat_test = "empirical", method = "LCTnorm", Nboot = 1000, seed = NULL )
SimuFdr( corr_theo, n = 100, Nsimu = 1, alpha = 0.05, stat_test = "empirical", method = "LCTnorm", Nboot = 1000, seed = NULL )
corr_theo |
the correlation matrix of Gaussien data simulated |
n |
sample size |
Nsimu |
number of simulations |
alpha |
level of multiple testing |
stat_test |
|
method |
choice between 'LCTnorm' and 'LCTboot', developped by Cai & Liu (2016), 'BH', traditional Benjamini-Hochberg (1995)'s procedure, and 'BHboot', Benjamini-Hochberg (1995)'s procedure with bootstrap evaluation of pvalues |
Nboot |
number of iterations for Monte-Carlo of bootstrap quantile evaluation |
seed |
seed for the Gaussian simulations |
Returns a line vector containing estimated values for fwer, fdr, sensitivity, specificity and accuracy.
Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the royal statistical society. Series B (Methodological), 289-300.
Cai, T. T., & Liu, W. (2016). Large-scale multiple testing of correlations. Journal of the American Statistical Association, 111(513), 229-240.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFdrCor, SimuFwer
Nsimu <- 1000 n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 alpha <- 0.05 SimuFdr(corr_theo,n,Nsimu,alpha,stat_test='empirical',method='LCTnorm')
Nsimu <- 1000 n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 alpha <- 0.05 SimuFdr(corr_theo,n,Nsimu,alpha,stat_test='empirical',method='LCTnorm')
Simulates Gaussian data with a given correlation matrix and applies a FWER controlling procedure on the correlations.
SimuFwer( corr_theo, n = 100, Nsimu = 1, alpha = 0.05, stat_test = "empirical", method = "Sidak", Nboot = 1000, stepdown = TRUE, seed = NULL )
SimuFwer( corr_theo, n = 100, Nsimu = 1, alpha = 0.05, stat_test = "empirical", method = "Sidak", Nboot = 1000, stepdown = TRUE, seed = NULL )
corr_theo |
the correlation matrix of Gaussien data simulated |
n |
sample size |
Nsimu |
number of simulations |
alpha |
level of multiple testing |
stat_test |
|
method |
choice between 'Bonferroni', 'Sidak', 'BootRW', 'MaxTinfty' |
Nboot |
number of iterations for Monte-Carlo of bootstrap quantile evaluation |
stepdown |
logical, if TRUE a stepdown procedure is applied |
seed |
seed for the Gaussian simulations |
Returns a line vector containing estimated values for fwer, fdr, sensitivity, specificity and accuracy.
Bonferroni, C. E. (1935). Il calcolo delle assicurazioni su gruppi di teste. Studi in onore del professore salvatore ortu carboni, 13-60.
Drton, M., & Perlman, M. D. (2007). Multiple testing and error control in Gaussian graphical model selection. Statistical Science, 22(3), 430-449.
Romano, J. P., & Wolf, M. (2005). Exact and approximate stepdown methods for multiple hypothesis testing. Journal of the American Statistical Association, 100(469), 94-108.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
Westfall, P.H. & Young, S. (1993) Resampling-based multiple testing: Examples and methods for p-value adjustment, John Wiley & Sons, vol. 279.
ApplyFwerCor, SimuFwer_oracle, SimuFdr
Nsimu <- 1000 n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 alpha <- 0.05 SimuFwer(corr_theo,n,Nsimu,alpha,stat_test='empirical',method='Bonferroni',stepdown=FALSE)
Nsimu <- 1000 n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 alpha <- 0.05 SimuFwer(corr_theo,n,Nsimu,alpha,stat_test='empirical',method='Bonferroni',stepdown=FALSE)
Simulates Gaussian data with a given correlation matrix and applies oracle MaxTinfty (i.e. Drton & Perlman (2007)'s procedure with the true correlation matrix) on the correlations.
SimuFwer_oracle( corr_theo, n = 100, Nsimu = 1, alpha = 0.05, stat_test = "empirical", method = "MaxTinfty", Nboot = 1000, stepdown = TRUE, seed = NULL )
SimuFwer_oracle( corr_theo, n = 100, Nsimu = 1, alpha = 0.05, stat_test = "empirical", method = "MaxTinfty", Nboot = 1000, stepdown = TRUE, seed = NULL )
corr_theo |
the correlation matrix of Gaussien data simulated |
n |
sample size |
Nsimu |
number of simulations |
alpha |
level of multiple testing |
stat_test |
|
method |
only 'MaxTinfty' available |
Nboot |
number of iterations for Monte-Carlo of bootstrap quantile evaluation |
stepdown |
logical, if TRUE a stepdown procedure is applied |
seed |
seed for the Gaussian simulations |
Returns a line vector containing estimated values for fwer, fdr, sensitivity, specificity and accuracy.
Drton, M., & Perlman, M. D. (2007). Multiple testing and error control in Gaussian graphical model selection. Statistical Science, 22(3), 430-449.
Roux, M. (2018). Graph inference by multiple testing with application to Neuroimaging, Ph.D., Université Grenoble Alpes, France, https://tel.archives-ouvertes.fr/tel-01971574v1.
ApplyFwerCor_Oracle, SimuFwer
Nsimu <- 1000 n <- 50 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 alpha <- 0.05 SimuFwer_oracle(corr_theo,n,Nsimu,alpha,stat_test='empirical',stepdown=FALSE,Nboot=100)
Nsimu <- 1000 n <- 50 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 alpha <- 0.05 SimuFwer_oracle(corr_theo,n,Nsimu,alpha,stat_test='empirical',stepdown=FALSE,Nboot=100)
Uncorrected testing procedure for correlations.
UncorrectedCor( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = FALSE, arr.ind = FALSE )
UncorrectedCor( data, alpha = 0.05, stat_test = "empirical", vect = FALSE, logical = FALSE, arr.ind = FALSE )
data |
matrix of observations |
alpha |
level of multiple testing (used if logical=TRUE) |
stat_test |
|
vect |
if TRUE returns a vector of adjusted p-values, corresponding to |
logical |
if TRUE, returns either a vector or a matrix where each element is equal to TRUE if the corresponding null hypothesis is rejected, and to FALSE if it is not rejected |
arr.ind |
if TRUE, returns the indexes of the significant correlations, with respect to level alpha |
Returns
the non-adjusted p-values, as a vector or a matrix depending of the value of vect
,
an array containing indexes for which correlation between variables
and
is significant, if
arr.ind=TRUE
.
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # p-values res <- UncorrectedCor(data,stat_test='empirical') round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly UncorrectedCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) # p-values res <- UncorrectedCor(data,stat_test='empirical') round(res,2) # significant correlations with level alpha: alpha <- 0.05 whichCor(res<alpha) # directly UncorrectedCor(data,alpha,stat_test='empirical',arr.ind=TRUE)
Returns an upper-triangle matrix, without the diagonal, containing the elements of a given vector.
unvectorize(vect)
unvectorize(vect)
vect |
A vector containing the upper triangle of a matrix, without the diagonal |
Returns an upper-triangle matrix where each entry is given by the vector containing the upper triangle of a matrix, without the diagonal.
vectorize
unvectorize(1:10)
unvectorize(1:10)
Returns a vector containing the upper triangle of a matrix, without the diagonal.
vectorize(mat)
vectorize(mat)
mat |
a square matrix |
Returns a vector containing the upper triangle of a matrix, without the diagonal.
unvectorize
vectorize(matrix(1:9,3,3))
vectorize(matrix(1:9,3,3))
Returns the indexes of an upper triangular matrix with logical entries.
whichCor(mat)
whichCor(mat)
mat |
A matrix with logical entries in the upper triangular part |
Returns the indexes of the upper triangular part where the entries are TRUE
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) res <- ApplyFwerCor(data,stat_test='empirical',method='Bonferroni',stepdown=FALSE) # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)
n <- 100 p <- 10 corr_theo <- diag(1,p) corr_theo[1,3] <- 0.5 corr_theo[3,1] <- 0.5 data <- MASS::mvrnorm(n,rep(0,p),corr_theo) res <- ApplyFwerCor(data,stat_test='empirical',method='Bonferroni',stepdown=FALSE) # significant correlations, level alpha: alpha <- 0.05 whichCor(res<alpha)