Learn R Programming

ERP (version 1.0.1)

gbtest: The Guthrie-Buchwald procedure for significance analysis of ERP data

Description

Monte-Carlo implementation of the Guthrie-Buchwald procedure (see Guthrie and Buchwald, 1991) which accounts for the auto-correlation among test statistics to control erroneous detections of short intervals.

Usage

gbtest(dta, design, design0 = NULL, graphthresh = 0.05, nbsamples = 1000)

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.
graphthresh
Graphical threshold (see Guthrie and Buchwald, 1991). Default is 0.05. As the FDR control level, the smaller is the graphical threshold, the more conservative is the procedure.
nbsamples
Number of samples in the Monte-Carlo method to estimate the residual covariance. Default is 1000.

Value

  • nbsignifintervalsNumber of significant intervals.
  • intervalsList of length nbsignifintervals which components give the indices of each significant intervals.
  • significantIndices of the time points for which the test is positive.
  • signalEstimated 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.
  • rhoEstimated lag-1 auto-correlation.
  • r2R-squared values for each of the T linear models.

Details

The Guthrie-Buchwald method starts from a preliminary estimation of r, the lag-1 autocorrelation, among test statistics. Then, the null distribution of the lengths of the intervals $I_alpha = t : pvalue_t

References

Guthrie, D. and Buchwald, J.S. (1991). Significance testing of difference potentials. Psychophysiology, 28, 240-244. Sheu, C.-F., Perthame, E., Lee Y.-S. and Causeur, D. (2014). Accounting for time dependence in large-scale multiple testing of event-related potentials data. Submitted.

See Also

erpavetest, erpfatest, erptest

Examples

Run this code
require(mnormt)
data(erpcz)
data(simerp)

# Paired comparison of ERP curves

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

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")

# Tests for significance of correlations

tests = gbtest(simerp[,1:251],design=model.matrix(~y,data=simerp),nbsamples=500)
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")

Run the code above in your browser using DataLab