eelbrain.testnd.ttest_rel¶

class
eelbrain.testnd.
ttest_rel
(y: Union[eelbrain._data_obj.NDVar, str], x: Union[eelbrain._data_obj.Factor, eelbrain._data_obj.Interaction, eelbrain._data_obj.NestedEffect, str, eelbrain._data_obj.NDVar], c1: Union[str, Tuple[str, ...]] = None, c0: Union[str, Tuple[str, ...]] = None, match: Union[eelbrain._data_obj.Factor, eelbrain._data_obj.Interaction, eelbrain._data_obj.NestedEffect, str] = None, sub: Union[eelbrain._data_obj.Var, numpy.ndarray, str] = None, ds: eelbrain._data_obj.Dataset = None, tail: int = 0, samples: int = 10000, pmin: float = None, tmin: float = None, tfce: Union[float, bool] = False, tstart: float = None, tstop: float = None, parc: str = None, force_permutation: bool = False, **criteria)¶ Massunivariate related samples ttest
The test data can be specified in two forms:
 In long form, with
y
supplying the data,x
specifying condition for each case andmatch
determining which cases are related.  In wide/repeated measures form, with
y
andx
both supplying data with matching case order.
Parameters:  y : NDVar
Dependent variable.
 x : categorial  NDVar
Model containing the cells which should be compared, or NDVar to which
y
should be compared. In the latter case, the next three parameters are ignored. c1 : str  tuple  None
Test condition (cell of
x
).c1
andc0
can be omitted ifx
only contains two cells, in which case cells will be used in alphabetical order. c0 : str  tuple  None
Control condition (cell of
x
). match : categorial
Units within which measurements are related (e.g. ‘subject’ in a withinsubject comparison).
 sub : index
Perform the test with a subset of the data.
 ds : None  Dataset
If a Dataset is specified, all dataobjects can be specified as names of Dataset variables.
 tail : 0  1  1
Which tail of the tdistribution to consider: 0: both (twotailed, default); 1: upper tail (onetailed); 1: lower tail (onetailed).
 samples : int
Number of samples for permutation test (default 10,000).
 pmin : None  scalar (0 < pmin < 1)
Threshold for forming clusters: use a tvalue equivalent to an uncorrected pvalue.
 tmin : scalar
Threshold for forming clusters as tvalue.
 tfce : bool  scalar
Use thresholdfree cluster enhancement. Use a scalar to specify the step of TFCE levels (for
tfce is True
, 0.1 is used). tstart : scalar
Start of the time window for the permutation test (default is the beginning of
y
). tstop : scalar
Stop of the time window for the permutation test (default is the end of
y
). parc : str
Collect permutation statistics for all regions of the parcellation of this dimension. For thresholdbased test, the regions are disconnected.
 force_permutation: bool
Conduct permutations regardless of whether there are any clusters.
 mintime : scalar
Minimum duration for clusters (in seconds).
 minsource : int
Minimum number of sources per cluster.
Notes
Also known as dependent ttest, paired ttest or repeated measures ttest. In the permutation cluster test, permutations are done within the categories of
match
. Cases with zero variance are set to t=0.Attributes:  c1_mean : NDVar
Mean in the c1 condition.
 c0_mean : NDVar
Mean in the c0 condition.
 clusters : None  Dataset
For clusterbased tests, a table of all clusters. Otherwise a table of all significant regions (or
None
if permutations were omitted). See also thefind_clusters()
method. difference : NDVar
Difference between the mean in condition c1 and condition c0.
 p : NDVar  None
Map of pvalues corrected for multiple comparison (or None if no correction was performed).
 p_uncorrected : NDVar
Map of pvalues uncorrected for multiple comparison.
 t : NDVar
Map of tvalues.
 tfce_map : NDVar  None
Map of the test statistic processed with the thresholdfree cluster enhancement algorithm (or None if no TFCE was performed).
 n : int
Number of cases.
 In long form, with
Methods¶
cluster (self, cluster_id) 
Retrieve a specific cluster as NDVar 
compute_probability_map (self, **sub) 
Compute a probability map 
find_clusters (self[, pmin, maps]) 
Find significant regions or clusters 
find_peaks (self) 
Find peaks in a thresholdfree cluster distribution 
info_list (self[, computation]) 
List with information about the test 
masked_c1 (self[, p]) 
c1 map masked by significance of the c1 c0 difference 
masked_difference (self[, p, name]) 
Difference map masked by significance 
masked_parameter_map (self[, pmin]) 
Create a copy of the parameter map masked by significance 