Lecturer
School of Sport Science, Bangor University, UK
CuttingGardens 2026 — Bangor Garden
On a computer press F11 to de/activate full-screen view.
QR code to
these slides:
Under H0, conditions are drawn from the same distribution. There is really one distribution.
Observed data:
| subj | condA | condB |
|---|---|---|
| 1 | A | B |
| 2 | A | B |
| 3 | A | B |
| 4 | A | B |
| 5 | A | B |
| 6 | A | B |
If H0 is true, we can swap the labels within each participant.
iteration #1
| s. | ||
|---|---|---|
| 1 | A | B |
| 2 | B | A |
| 3 | A | B |
| 4 | B | A |
| 5 | A | B |
| 6 | B | A |
iteration #2
| s. | ||
|---|---|---|
| 1 | A | B |
| 2 | A | B |
| 3 | B | A |
| 4 | B | A |
| 5 | A | B |
| 6 | B | A |
…
iteration #N
| s. | ||
|---|---|---|
| 1 | B | A |
| 2 | B | A |
| 3 | A | B |
| 4 | A | B |
| 5 | B | A |
| 6 | A | B |
compare the observed statistic against the empirical null distribution
the emprical null distribution should be constructed using all possible reshuffles… or a large random sample of them (Monte Carlo)
the empirical null distribution and the observed values can be constructed for any metric, not necessarily t-statistic (e.g., cluster metrics)
For a meaningful shuffle, all CondB (condA) values for a certain subject must be kept together.
Careful when using for loops.
data(subj, time, chan, cond)
data (subj x cond, EEG features)
For example, time and channels must be kept together.
| subj | cond | c1_t1 | c1_t2 | c1_t3 | c2_t1 | c2_t2 | c2_t3 |
|---|---|---|---|---|---|---|---|
| 1 | A | . | . | . | . | . | . |
| 1 | B | . | . | . | . | . | . |
| 2 | A | . | . | . | . | . | . |
| 2 | B | . | . | . | . | . | . |
| 3 | A | . | . | . | . | . | . |
| 3 | B | . | . | . | . | . | . |
Swap enrire rows
A solution to the jelly bean problem
For each iteration, you get a t-map across all features.
For each iteration, retain the maximum |t| across all features.
Across all iterations, build a distribution of maxT values
What survives is more extreme than the most extreme values obtained by chance (i.e., under the H0 of exchangeability) across all EEG dimensions
Effects tend to extend across neighbouring features (e.g., volume conduction, temporal autocorrelation, spectral smoothing).
Cluster forming
threshold the uncorrected t-map (e.g., those corresponding to p < 0.05, uncorrected). The forming threshold is a parametric criterion (|t| ≥ 2.03, df = 35) used only to draw boundaries; the inference rests on the empirical null of the cluster metric.
define adjacency (e.g., neighbouring time points, channels within a certain distance)
separately for positive and negative t-values
clusters = set of suprathreshold, adjacent, same-sign t-values
Cluster metrics
cluster extent/size/numerosity = number of features in the cluster
cluster height/most extreme value = most extreme t-value in the cluster
cluster mass = sum of t-values in the cluster
cluster mass (robust) = median of t-values in the cluster times the number of features in the cluster
Remember, the H0 distribution can be built with any metric. For example, cluster metrics.
On observed data:
On each Monte Carlo iteration:
Test the observed cluster metrics against the empirical H0 distribution of max cluster metrics
Proportion of null maxima at or beyond an observed cluster metric = p-value for that cluster
Cluster-based permutation testing did not test the location or the boundaries of the cluster. It tested the existence of a cluster of a certain mass.
Cluster forming depends on the threshold chosen (e.g., p < 0.05, uncorrected). Different thresholds can yield different clusters.
Not well behaved where the same effect has different signs across the dimensions (e.g., N170 and VPP)
A MATLAB toolbox for permutation-based inference on EEG data.
Three inputs:
| input | content |
|---|---|
Y |
observations × features (e.g., participant × condition rows; channel × time columns) |
X |
design: contrasts, group codes, or continuous predictors |
dataStruct |
what each row of Y is (participant, condition, group, …) |
Scripting, not programming: the user sets configuration fields; the toolbox validates every field before anything runs.