Learn R Programming

erpR (version 0.2.0)

erp.t: plot t-test comparisons at all timepoints between two sets of ERP data frames (single electrode)

Description

This function performs a series of t-tests on each timepoint comparing two sets of ERP data frames. The first set is specified by base1 and numbers1. The second set is specified by base2 and numbers2.

Usage

erp.t(base1, base2, numbers1, numbers2 = numbers1, startmsec = -200, endmsec=1200, electrode, smo = NULL, paired = TRUE, alpha = 0.05, erplist1 = NULL, erplist2 = erplist1, sig = NULL, main = electrode, col = c("blue", "red"), ...)

Arguments

base1
a string indicating the beginning of the name of the first set of ERP data frames.
base2
a string indicating the beginning of the name of the second set of ERP data frames.
numbers1
the numbers of the subjects of the first set of ERP data frames.
numbers2
The numbers of the subjects of the second set of ERP data frames.
startmsec
the start time (in ms) of the ERP vector.
endmsec
the end time (in ms) of the ERP vector.
electrode
a string indicating the electrode to be considered in the analysis.
smo
the smoothing parameter to apply (see smooth.spline). Default is NULL and no smoothing is applied.
paired
logical. This argument specifies if the t-tests are paired or not.
alpha
the alpha of the t-tests.
erplist1
a list containing the ERP data frames specified in base1 and numbers1.
erplist2
a list containing the ERP data frames specified in base2 and numbers2.
sig
if NULL, then a series of t-tests is computed. If an appropriate object is specified (i.e. the object returned by erp.t or scalp.t) then the results are retrieved by this object and the function simply plots the results.
main
plot title.
col
the colors of the waveforms.
...
further parameters to be passed to erp.

Value

The function plots two ERP waveforms. One is an average of the first set of specified data frames, and the other is an average of the second set of specified data frames. The colors of the waveforms are specified in color.list. Timepoints on which the t-test is significant are highlighted by grey bars. The function also returns an object with the results of the t-tests. This object can be used for future plots with erp.t or scalp.t, by specifying it as the argument sig.

See Also

erp, scalp.t, ~~~

Examples

Run this code

## Not run: 
# data(ERPsets)
# 
# erp.t("Exp1_word_subj", "Exp1_nonword_subj", 1:20, 1:20, 
# electrode="Fp1", ylim=c(-10,10),  startmsec=-200, 
# endmsec=1500, erplist1=ERPsets, erplist2=ERPsets, 
# col=c("blue", "red"))
# ## End(Not run)


Run the code above in your browser using DataLab