plot t-test comparisons at all timepoints between two ERP set of data frames (scalp array)

Share:

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 is specified by base2 and numbers2. A scalp plot of the results is returned.

Usage

1
2
3
4
5
6
scalp.t(base1, base2, numbers1, numbers2 = NULL, paired = TRUE,
alpha = 0.05, sig = NULL, erplist1 = NULL, erplist2 = erplist1, 
smo = NULL, layout = 1, ylims = "auto", yrev = TRUE,
startmsec = -200, endmsec = 1200, lwd = c(1, 1), lty = c(1, 1), 
color.list = c("blue", "red"), legend = F, legend.lab = "default",
t.axis = seq(-100, endmsec, 200), scalp.array=NULL)

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 .

paired

logical. This argument specifies if the t-tests are paired or not.

alpha

the alpha of the t-tests.

sig

if NULL, then a series of t-test is computed. If an appropriate object is specified (i.e. an object returned by erp.t or scalp.t) then the results are retrieved by this object and the function simply plots the results.

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.

smo

the smoothing parameter to apply (see smooth.spline). Default is NULL and no smoothing is applied.

layout

A number indicating the layout of electrodes to be plotted. Currently only few default layouts are supported (a number from 1 to 5). Alternatively, a character vector specifying the layout may be supplied (see Details).

ylims

a number indicating the upper and lower limits of the y-axis. If "auto", the function calculates the y-limits automatically.

yrev

logical. If TRUE, the y-axis is plotted with negative values upward.

startmsec

the start time (in ms) of the ERP vector

endmsec

the end time (in ms) of the ERP vector

lwd

a vector specifying the line width to be associated with each ERP data frame specified in categ

lty

a vector specifying the line types to be associated with each ERP data frame specified in categ

color.list

a vector specifying the colors to be associated with each ERP data frame specified in categ

legend

logical. If TRUE, a legend with object names is drawn in the top-right corner of the array.

legend.lab

the legend labels. If "default", the names are retrieved from categ.

t.axis

the position of the ticks of an additional axis indicating the time. This axis is plotted in the bottom-left corner of the plot array.

scalp.array

This argument is vector of two values indicating the number of panels of the plot, as number of rows and number of columns respectively. If a default layout is specified, the number of panels is automatically computed. See also Details.

Details

The layout parameter can be a number (from 1 to 5), that specifies some default electrode arrangements (currently only a few default arrangements are supported). Otherwise, the argument may be a character vector indicating the names of the electrodes to be plotted. The plot is divided in a number of panels as specified in scalp.array. The names specified will be plotted from top to bottom and from left to right. If "blank" is specified an empty panel will be plotted. If "xaxis" is specified a x axis indicating time will be plotted. If "yaxis" is specified a y axis indicating voltage will be plotted.

Value

The function plots a map of two series of ERP waveforms in an array resembling the topographic locations of the electrodes on the scalp. One series is an average of the first set of specified data frames, and the other series is the average of the second set of specified data frames. The colors of the waveforms are specified in color.list. Timepoints in 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.

Author(s)

Giorgio Arcara

See Also

erp, erp.t

Examples

1
2
3
4
5
6
7
8
## Not run: 
data(ERPsets)

scalp.t("Exp1_word_subj", "Exp1_nonword_subj", 1:20, 1:20, smo=0, 
layout=1, ylims=10, startmsec=-200, endmsec=1500, 
color.list=c("blue", "red"), erplist1=ERPsets, erplist2=ERPsets)

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.