# Group level sensor space permutation cluster t-test	on n channels?

**URL:** <https://mne.discourse.group/t/group-level-sensor-space-permutation-cluster-t-test-on-n-channels/743>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [June 8, 2014, 1:01pm UTC](https://mne.discourse.group/t/group-level-sensor-space-permutation-cluster-t-test-on-n-channels/743 "2014-06-08T13:01:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 8, 2014, 1:01pm UTC](https://mne.discourse.group/t/group-level-sensor-space-permutation-cluster-t-test-on-n-channels/743/1 "2014-06-08T13:01:46Z")

</div>

Hi MNE list,

I'm having a bit of trouble on getting group level sensor space stats going. I've run similar in Fieldtrip and just create an array (or matrix in matlab speak) consisting of participants x channels x samples, and looking through the examples it seems we need to work directly with the array data too. But none of the functions I've used seem to accept anything other than a 2d array (3d for TF) and all the examples seem to either be single channel or one sample t-tests.

Are group level stats available currently or does something need to be written / cobbled together to get them to work?

Thanks for any help,

Peter

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 8, 2014, 1:35pm UTC](https://mne.discourse.group/t/group-level-sensor-space-permutation-cluster-t-test-on-n-channels/743/2 "2014-06-08T13:35:25Z")

</div>

Hi Peter,

> Hi MNE list,
> 
> I'm having a bit of trouble on getting group level sensor space stats  
> going. I've run similar in Fieldtrip and just create an array (or matrix in  
> matlab speak) consisting of participants x channels x samples, and looking  
> through the examples it seems we need to work directly with the array data  
> too. But none of the functions I've used seem to accept anything other than  
> a 2d array (3d for TF) and all the examples seem to either be single  
> channel or one sample t-tests.

you can use all `mne.stats.permutation_cluster_XXX` functions. They accept  
mutli-dimensional arrays as input. Irrespective of the cluster-forming stat  
used (t-test, f-test) they will perform a cluster permutation test.  
For sensor space data you first have to assemble a corresponding matrix /  
array.

X = np.array([e.data for e in m\_evoeds])

To yield meaningful results you need to specify a connectivity structure,  
e.g., based on the fieldtrip neighbor definitions.  
C.f. [https://github.com/mne-tools/mne-python/pull/1306](https://github.com/mne-tools/mne-python/pull/1306) which we recently  
added.

The input matrix is then expected to be of size n\_subjects, n\_times,  
n\_channels.

HTH,  
Denis

Are group level stats available currently or does something need to be

> written / cobbled together to get them to work?
> 
> Thanks for any help,
> 
> Peter
> 
> &nbsp;&nbsp;&nbsp;\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Peter Goodin,  
> BSc (Hons), Ph.D Candidate.
> 
> Brain and Psychological Sciences Research Centre (BPsych)  
> Swinburne University,  
> Hawthorn, Vic, 3122
> 
> [http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149](http://www.swinburne.edu.au/swinburneresearchers/index.php?fuseaction=profile&pid=4149)
> 
> Monash Alfred Psychiatry Research Centre (MAPrc)  
> Level 4, 607 St Kilda Road,  
> Melbourne 3004
> 
> \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> Mne\_analysis mailing list  
> Mne\_analysis at nmr.mgh.harvard.edu  
> [Mne\_analysis Info Page](https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis)
> 
> The information in this e-mail is intended only for the person to whom it  
> is  
> addressed. If you believe this e-mail was sent to you in error and the  
> e-mail  
> contains patient information, please contact the Partners Compliance  
> HelpLine at  
> [MyComplianceReport.com: Compliance and Ethics Reporting](http://www.partners.org/complianceline) . If the e-mail was sent to you in  
> error  
> but does not contain patient information, please contact the sender and  
> properly  
> dispose of the e-mail.

-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20140608/03097bf1/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140608/03097bf1/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [June 9, 2014, 1:31am UTC](https://mne.discourse.group/t/group-level-sensor-space-permutation-cluster-t-test-on-n-channels/743/3 "2014-06-09T01:31:15Z")

</div>

Dear Denis,

Thank you very much for the code snippet and neighbour definitions advice! As usual the problem was simply user error. My evoked data was being imported and placed into an array of arrays instead of a single multi-dimensional array, so the array object properties (specifically x.ndim) wasn't being assigned.

Peter
