Simply EEGLAB
STUDY designs and variables
Station 8 · Lesson 4 · EEGLAB 2026.1
In the GUI
- StudySelect/Edit study design(s)Edit STUDY design -- pop_studydesign()
- Design name
STUDY.design 1 - Edit the independent variables for this design
Categorical variable: condition - Values (animal - distractor)Categorical variable: group - Values (F - M) - New
Design 2 - RenameStudy design name:Ok
image x gender - NewAdd variable
- Select independent variableSelect variable valuesOk
conditionanimaldistractor - NewOk
groupFM - NewRename
image only - Design nameOk
image x gender - Re-save STUDY file (if saved previously)
animal_mine.study - Ok
Selecting STUDY design 2Resaving STUDY
Script
STUDY = std_makedesign(STUDY, ALLEEG, 2, 'name', 'image x gender', ...
'variable1', 'condition', 'values1', {'animal', 'distractor'}, 'vartype1', 'categorical', ...
'variable2', 'group', 'values2', {'F', 'M'}, 'vartype2', 'categorical');
STUDY = std_makedesign(STUDY, ALLEEG, 3, 'name', 'image only', ...
'variable1', 'condition', 'values1', {'animal', 'distractor'}, 'vartype1', 'categorical', ...
'variable2', 'none');
STUDY = std_selectdesign(STUDY, ALLEEG, 2);
STUDY = pop_savestudy(STUDY, ALLEEG, 'savemode', 'resave');
for k = 1:numel(STUDY.design)
d = STUDY.design(k);
fprintf('Design %d: %s\n', k, d.name);
for v = 1:numel(d.variable)
if ~isempty(d.variable(v).label)
fprintf(' %-10s paired: %-4s values: %s\n', d.variable(v).label, ...
d.variable(v).pairing, strjoin(d.variable(v).value, ' '));
end
end
end
fprintf('Current design: %d\n', STUDY.currentdesign);
eeglab redraw;Which value should I choose?
| Within subjects | Between subjects | |
|---|---|---|
| Meaning | Each participant has every value | Each participant has one value |
| In D6 | Picture type: animal and distractor | Gender: F and M |
| Usually stored in | condition | group |
| Test | paired: compares each participant with themselves, removing differences between people | unpaired: compares two groups of different people |
| Statistical power | Higher for the same number | Lower, and needs more participants |
| Your question | Design | Why |
| Does the ERP differ between animal pictures and the others? | 3, image only | A direct paired test on 14 participants, and a plot with two curves instead of four. The 2×2 design also computes the main effect of picture, but it is harder to read. |
| Does the picture effect differ between women and men? | 2, image x gender | The interaction between the two variables needs both in one design. |
| Does the ERP differ between women and men? | A design with group only | unpaired, 7 against 7. |
For your Methods
A 2 × 2 mixed design was defined in the STUDY, with image category (animal, distractor) as a within-subject factor and gender ([7] female, [7] male) as a between-subject factor (std_makedesign, EEGLAB 2026.1).