preTtest: Parameter checks and data preparation in 'arrayTtest'

Description Usage Arguments See Also

View source: R/ttest.R

Description

preTtest performs parameter checking, combines .arraydat and .arraydat2 (if not NULL), reshapes .arraydat to be a matrix with subjects in rows, and returns a list with the data and all parameters. It is called by arrayTtest.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
preTtest(
  .arraydat,
  .arraydat2,
  paired,
  groups,
  mu,
  var_equal,
  id_dim,
  verbose,
  tfce,
  perm
)

Arguments

.arraydat

a numeric array with named dimnames containing EEG (or other) data. Missing values are not allowed. Must have at least three dimensions with names "chan", "time", and "id" (see also id_dim)

.arraydat2

a numeric array with named dimnames containing EEG (or other) data (default: NULL). If provided, see the parameter paired for running paired or independent-samples t-tests

paired

logical scalar, only used if .arraydat2 is provided. If paired is FALSE (default), the function computes independent samples t-tests, otherwise paired samples t-tests are performed

groups

provides an alternative (and more efficient) way to perform independent samples t-tests; a character, factor, or integer vector which defines group membership. Groups is ignored if .arraydat2 is not missing. NA values code subjects to drop.

mu

a numeric scalar indicating the true value of the mean (or difference between means, if two-sample tests are performed)

var_equal

a logical scalar whether the variances are equal (only relevant for independent-samples t-tests). If TRUE, the pooled variance is used to estimate the variance. If FALSE (default), the Welch (or Satterthwaite) approximation to the degrees of freedom is used.

id_dim

name of the dimension which identifies the subjects (default: "id")

verbose

logical value indicating if p-values should be computed for the traditional t-test results (default: TRUE)

tfce

logical value if TFCE is requested in arrayTtest

perm

logical value if permutation is requested in arrayTtest

See Also

arrayTtest is the higher-level function exported to the user. isTtest and osTtest are internal functions relying on the returned object of preTtest.


tdeenes/eegR documentation built on April 19, 2021, 4:17 p.m.