eelbrain.table.frequencies(y, x=None, of=None, sub=None, data=None)

Calculate frequency of occurrence of the categories in y

  • y (univariate) – Values whose frequencies are of interest.

  • x (categorial) – Optional model defining cells for which frequencies are displayed separately.

  • of (categorial) – With x constant within of, only count frequencies for each value in of once. (Compress y and x before calculating frequencies.)

  • sub (index) – Only use a subset of the data.

  • data (Dataset) – If data is specified, other parameters can be strings naming for variables in data.


freq – Dataset with frequencies.

Return type:



A simple sample dataset:

>>> data = Dataset()
>>> data['a'] = Factor('aabbcc')
>>> data['x'] = Factor('xxxyyy')

Display frequency of a single factor’s cells:

>>> print(table.frequencies('a', data=data))
cell   n
a      2
b      2
c      2

Display frequency of interaction cells:

>>> print(table.frequencies('a', 'x', data=data))
x   a   b   c
x   2   1   0
y   0   1   2