eelbrain.Celltable

class eelbrain.Celltable(y, x=None, match=None, sub=None, cat=None, data=None, coercion=<function asdataobject>, dtype=None)[source]

Divide y into cells defined by x.

Parameters:
  • y (eelbrain._data_obj.Var | eelbrain._data_obj.NDVar) – dependent measurement

  • x (eelbrain._data_obj.Factor | eelbrain._data_obj.Interaction) – Model (Factor or Interaction) for dividing y.

  • match (eelbrain._data_obj.Factor | eelbrain._data_obj.Interaction) – Factor on which cases are matched (i.e. subject for a repeated measures comparisons). If several data points with the same case fall into one cell of x, they are combined using match_func. If match is not None, Celltable.groups contains the {Xcell -> [match values of data points], …} mapping corres- ponding to self.data

  • sub (numpy.ndarray) – Bool array of length N specifying which cases to include

  • cat (Sequence[str | tuple[str, ...]]) – Only retain data for these cells. Data will be sorted in the order of cells occuring in cat.

  • data (dict) – If a Dataset is specified, input items (y / x / match / sub) can be str instead of data-objects, in which case they will be retrieved from the Dataset.

  • coercion (Callable) – Function to convert the y parameter to to the dependent varaible (default: asdataobject).

  • dtype (dtype) – If specified, y will be converted to this type.

Examples

Split a repeated-measure variable y into cells defined by the interaction of A and B:

>>> c = Celltable(y, A % B, match=subject)
y

y after evaluating input parameters.

Type:

eelbrain._data_obj.Var | eelbrain._data_obj.NDVar

x

x after evaluating input parameters.

Type:

eelbrain._data_obj.Factor | eelbrain._data_obj.Interaction

match

match after evaluating input parameters.

Type:

eelbrain._data_obj.Factor | eelbrain._data_obj.Interaction

sub

Boolean array; sub after evaluating input parameters.

Type:

numpy.ndarray

cells

List of all cells in x.

Type:

list[str | tuple]

data

Data (y[index]) in each cell, mapping cell to data.

Type:

dict

data_indexes

For each cell, a boolean-array specifying the index for that cell in x.

Type:

dict

\*\*If ``match`` is specified**
within

Dictionary that specifies for each cell pair whether the corresponding comparison is a repeated-measures or an independent measures comparison (only available when the input argument match is specified.

Type:

dict

all_within

Whether all comparison are repeated-measures comparisons or not.

Type:

bool

groups

A slice of the match argument describing the group members for each cell.

Type:

dict

Methods

cellname(cell[, delim])

Produce a str label for a cell.

cellnames([delim])

Return a list of all cell names as strings.

data_for_cell(cell)

Retrieve data for a cell, allowing advanced cell combinations

get_data([out])

get_statistic([func])

Return a list with a * func(data) for each data cell.

get_statistic_dict([func])

Return a {cell: func(data)} dictionary.

variability([error, within_subject, cell, ...])

Variability measure