ClustME: a MATLAB Toolbox for Fast Cluster-Based Permutation Testing with Linear Mixed-Effects Models
ClustME is a MATLAB toolbox for fast, family-wise error rate (FWER)-controlled cluster inference in hierarchical time-series data.
It combines linear mixed-effects (LME) modelling with cluster-based permutation testing, allowing users to analyse repeated observations, subject -level structure, and trial-level predictors without collapsing observations to subject-level averages.
This toolbox is available on GitHub. This DOI relates to release v1.0.0.
Directly combining LMEs with cluster-based permutation testing is usually computationally prohibitive, because a full mixed-effects model would need to be refitted at every time sample and for every randomisation. ClustME avoids this by estimating a pooled, static estimate of the marginal covariance matrix V and reusing it during null generation.
At each time sample, the test statistic is a Generalized Least Squares (GLS) contrast derived from the specified LME model. GLS uses the estimated covariance structure to account for hierarchical dependence that ordinary least-squares approaches would otherwise ignore. This makes mixed-effects cluster inference feasible on standard hardware, provided that the selected randomisation method matches the design's exchangeability structure.
Early release note
ClustME is currently in early release. The core v1.0.0 functionality has been validated, but user feedback will help improve the toolbox across a wider range of datasets and designs. Please use the GitHub repository or email guy.yona@ndcn.ox.ac.uk to ask questions, report issues, or suggest improvements.
We welcome researchers wishing to reuse our data to contact the creators of datasets. If you are unfamiliar with analysing the type of data we are sharing, have questions about the acquisition methodology, need additional help understanding a file format, or are interested in collaborating with us, please get in touch via email. Our current members have email addresses on our main site. The corresponding author of an associated publication, or the first or last creator of the dataset are likely to be able to assist, but in case of uncertainty on who to contact, email Ben Micklem, Research Support Manager at the MRC BNDU.
Distributed under the GNU General Public License (GPL) version 3.0.

