eelbrain.pipeline.GroupVar

class eelbrain.pipeline.GroupVar(groups, task=None)[source]

Group membership for each subject

Parameters:
  • groups (Sequence[str] | dict[str, str]) – Groups to label. A sequence of group names to label each subject with the group it belongs to (subjects must not be members of more than one group). Alternatively, a {group: label} dictionary can be used to assign a label different from the group name.

  • task (str) – Only apply the variable to events from this task.

Notes

A GroupVar is an across-subject variable: its definition spans subjects, so it is added where different subjects’ data are combined. It is thus only present in data that spans subjects (e.g. e.load_selected_events(-1), but not e.load_selected_events()). Consequently it can not be used in definitions that are evaluated per subject, such as an epoch sel expression or an evoked model. The same applies to any variable derived from a GroupVar.

Examples

Assuming an experiment that defines two groups, 'patient' and 'control', these groups could be labeled with:

GroupVar(['patient', 'control'])