Last data update: 2014.03.03

R: FDR- and FWER-controlling Multiple testing of ERP data
erptestR Documentation

FDR- and FWER-controlling Multiple testing of ERP data

Description

Classical FDR- and FWER-controlling multiple testing procedures for ERP data in a linear model framework.

Usage

erptest(dta, design, design0 = NULL, method = "BH", alpha = 0.05, pi0 = 1)

Arguments

dta

Data frame containing the ERP curves: each column corresponds to a time frame and each row to a curve.

design

Design matrix of the full model for the relationship between the ERP and the experimental variables. Typically the output of the function model.matrix

design0

Design matrix of the null model. Typically a submodel of the full model, obtained by removing columns from design. Default is NULL, corresponding to the model with no covariates.

method

FDR- or FWER- controlling multiple testing procedures as available in the function p.adjust. Default is "BH", for the Benjamini-Hochberg procedure (see Benjamini and Hochberg, 1995).

alpha

The FDR or FWER control level. Default is 0.05

pi0

An estimate of the proportion of true null hypotheses, which can be plugged into an FDR controlling multiple testing procedure to improve its efficiency. Default is 1, corresponding to the classical FDR controlling procedures. If NULL, the proportion is estimated using the function pval.estimate.eta0 of package fdrtool, with the method proposed by Storey and Tibshirani (2003).

Details

The multiple testing corrections of the p-values are described in the help documentation of the function p.adjust du package stats.

Value

pval

p-values of the tests.

correctedpval

Corrected p-values, for the multiplicity of tests. Depends on the multiple testing method (see function p.adjust).

significant

Indices of the time points for which the test is positive.

pi0

Value for pi0: if the input argument pi0 is NULL, the output is the estimated proportion of true null hypotheses using the method by Storey and Tibshirani (2003).

test

F-statistics.

df1

Residual degrees of freedom for the full model.

df0

Residual degrees of freedom for the null model.

signal

Estimated signal: a pxT matrix, where p is the difference between the numbers of parameters in the full and null models and T the number of frames.

r2

R-squared values for each of the T linear models.

Author(s)

David Causeur - david.causeur@agrocampus-ouest.fr

References

Benjamini, Y., and Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society Series B, 289-300.

Benjamini, Y., and Yekutieli, D. (2001). The control of the false discovery rate in multiple testing under dependency. Annals of Statistics 29, 1165-1188.

Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6, 65-70.

Hommel, G. (1988). A stagewise rejective multiple test procedure based on a modified Bonferroni test. Biometrika, 75, 383-386.

Hochberg, Y. (1988). A sharper Bonferroni procedure for multiple tests of significance. Biometrika, 75, 800-803.

Shaffer, J. P. (1995). Multiple hypothesis testing. Annual Review of Psychology, 46, 561-576.

Sarkar, S. (1998). Some probability inequalities for ordered MTP2 random variables: a proof of Simes conjecture. Annals of Statistics, 26, 494-504.

Sarkar, S., and Chang, C. K. (1997). Simes' method for multiple hypothesis testing with positively dependent test statistics. Journal of the American Statistical Association, 92, 1601-1608.

Sheu, C.-F., Perthame, E., Lee Y.-S. and Causeur, D. (2016). Accounting for time dependence in large-scale multiple testing of event-related potential data. To appear in Annals of Applied Statistics.

Wright, S. P. (1992). Adjusted P-values for simultaneous inference. Biometrics, 48, 1005-1013.

See Also

erpavetest, erpfatest, gbtest, p.adjust, pval.estimate.eta0

Examples

require(mnormt)
require(fdrtool)

data(erpcz)
data(simerp)

# Paired comparison of ERP curves

tests = erptest(erpcz[,1:251],design=model.matrix(~Subject+Instruction,data=erpcz),
   design0=model.matrix(~Subject,data=erpcz))

frames = seq(0,1001,4)
plot(frames,tests$signal,type="l",xlab="Time (ms)",
   ylab="Difference ERP curves")
points(frames[tests$significant],rep(0,length(tests$significant)),
   pch=16,col="blue")
title("Paired comparison at electrode CZ")

# Independent two-group comparison of ERP curves

tests = erptest(erpcz[,1:251],design=model.matrix(~Instruction,data=erpcz))

frames = seq(0,1001,4)
plot(frames,tests$signal,type="l",xlab="Time (ms)",
   ylab="Difference ERP curves")
points(frames[tests$significant],rep(0,length(tests$significant)),
   pch=16,col="blue")
title("Independent comparison at electrode CZ")

# Tests for significance of correlations

tests = erptest(simerp[,1:251],design=model.matrix(~y,data=simerp))
plot(frames,sign(tests$signal)*sqrt(tests$r2),type="l",xlab="Time (ms)",
   ylab="Correlation",ylim=c(-1,1))
points(frames[tests$significant],rep(-1,length(tests$significant)),
   pch=16,col="blue")
title("Simulation")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(ERP)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ERP/erptest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: erptest
> ### Title: FDR- and FWER-controlling Multiple testing of ERP data
> ### Aliases: erptest
> ### Keywords: ERP data FDR Multiple testing
> 
> ### ** Examples
> 
> require(mnormt)
Loading required package: mnormt
> require(fdrtool)
Loading required package: fdrtool
> 
> data(erpcz)
> data(simerp)
> 
> # Paired comparison of ERP curves
> 
> tests = erptest(erpcz[,1:251],design=model.matrix(~Subject+Instruction,data=erpcz),
+    design0=model.matrix(~Subject,data=erpcz))
> 
> frames = seq(0,1001,4)
> plot(frames,tests$signal,type="l",xlab="Time (ms)",
+    ylab="Difference ERP curves")
> points(frames[tests$significant],rep(0,length(tests$significant)),
+    pch=16,col="blue")
> title("Paired comparison at electrode CZ")
> 
> # Independent two-group comparison of ERP curves
> 
> tests = erptest(erpcz[,1:251],design=model.matrix(~Instruction,data=erpcz))
> 
> frames = seq(0,1001,4)
> plot(frames,tests$signal,type="l",xlab="Time (ms)",
+    ylab="Difference ERP curves")
> points(frames[tests$significant],rep(0,length(tests$significant)),
+    pch=16,col="blue")
> title("Independent comparison at electrode CZ")
> 
> # Tests for significance of correlations
> 
> tests = erptest(simerp[,1:251],design=model.matrix(~y,data=simerp))
> plot(frames,sign(tests$signal)*sqrt(tests$r2),type="l",xlab="Time (ms)",
+    ylab="Correlation",ylim=c(-1,1))
> points(frames[tests$significant],rep(-1,length(tests$significant)),
+    pch=16,col="blue")
> title("Simulation")
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>