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

Divide y into cells defined by x.

  • y (data-object) – dependent measurement

  • x (categorial) – Model (Factor or Interaction) for dividing y.

  • match (categorial) – 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

  • sub (bool array) – Bool array of length N specifying which cases to include

  • cat (None | sequence of cells of x) – Only retain data for these cells. Data will be sorted in the order of cells occuring in cat.

  • ds (Dataset) – 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 (numpy.dtype) – If specified, y will be converted to this type.


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

>>> c = Celltable(y, A % B, match=subject)
  • y (data-object) – y after evaluating input parameters.

  • x (categorial) – x after evaluating input parameters.

  • match (categorial | None) – match after evaluating input parameters.

  • sub (bool array | None) – sub after evaluating input parameters.

  • cells (list of (str | tuple)) – List of all cells in x.

  • data ({cell: data}) – Data (y[index]) in each cell.

  • data_indexes ({cell: index-array}) – For each cell, a boolean-array specifying the index for that cell in x.

  • specified** (**If match is) –

  • within (dict(cell1, cell2 -> bool)) – 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.

  • all_within (bool) – Whether all comparison are repeated-measures comparisons or not.

  • groups (dict(cell -> group)) – A slice of the match argument describing the group members for each cell.


cellname(cell[, delim])

Produce a str label for a cell.


Return a list of all cell names as strings.


Retrieve data for a cell, allowing advanced cell combinations



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


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

variability([error, pool])

Variability measure