Skip to content

DOC: Check consistency between docstring and tutorial for paired permutation cluster test #13406

Open

Description

@Cathaway

Proposed documentation enhancement

This tutorial Mass-univariate twoway repeated measures ANOVA on single trial power — MNE 1.10.1 documentation gave an example that puts number of replications/subjects as the first dimension, akin to 1), but the API doc mne.stats.permutation_cluster_test — MNE 1.10.1 documentation tells me I should take after 2)? If I'm not mistaken one of these documentations needs revision right?

Activity

  1. welcome commented on Sep 2, 2025

    @welcome

    Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴

  2. scott-huberty commented on Sep 2, 2025

    @scott-huberty
    Contributor

    Hey @Cathaway can you help me understand better the discrepancy between the tutorial and the API documentation, and if you have a suggestion for improving one or both of these pages of the documentation, that would be helpful!

    I interpret the API doc for the X parameter of permutation_cluster_test as: Pass a list of Numpy arrays, where n_observations corresponds to dimension 0 in each array. (and This is what the tutorial does, no?)

    Is the issue that the API doc uses the term "first dimension" ("The first dimension of each array is the number of observations from that group"), which is ambiguous because indexing in Python is 0-based? i.e. does "first dimension" mean axis 0 , or does it mean axis 1 ?

    If so, I agree that this could be more clear!

  3. Cathaway commented on Sep 2, 2025

    @Cathaway
    Author

    Hi @scott-huberty thank you for the reply! The way I understand the API doc is (if I understood it at all) that permutation_cluster_test() accepts a list of numpy array, each array contains data in one experimental condition, within each data each row represents one subject/replication, and each column represents a datapoint/timepoint. Hence the general structure should be (n_condition x n_subject x n_timepoint) given the data has only one channel:

    Timepoint 1 Timepoint 2 ... Timepoint n
    Subject 1 ...
    Subject 2 ...
    Subject ... ...
    Subject n ...

    (for each array in the list)

    If this is true my problem is that the tutorial I cited gave a table that's supposed to represent the structure of example data (titled Sample data layout, under section Setup repeated measure ANOVA), without saying whether this table is the structure of data before or after transforming to meet the function's requirement. We need two tables that clearly say, e.g. Table 1 is the data structure as is, Table 2 is the data structure required by the function. So that users can get a very clear message of how they should prepare the data.

    I'd also suggest put up a table like that in the API doc to graphically show what's the required data structure

  4. dhruvildave235 commented on Apr 13, 2026

    @dhruvildave235

    Hi, I would like to work on this.

    From what I understood, the confusion is mainly about how the data should be structured (axis=0 vs axis=1), and the tutorial doesn’t clearly show the transformation to the required format.

    I can update both:

    the API doc to clearly mention axis=0
    the tutorial to include a simple table/example showing the expected shape

    Please let me know if that sounds good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions