Skip to content

Issue A1: Stats Tutorial Rework — Proper Statistical Testing for PSDs #9

@Ramdam17

Description

@Ramdam17

Description:

Rework the statistical analysis in getting_started.ipynb to use appropriate tests instead of basic t-tests on epoch-averaged PSDs.

Context:
The current tutorial computes PSDs averaged across epochs, then runs t-tests. This approach is statistically problematic because:

  • Averaging across epochs loses trial-level variance information
  • Simple t-tests don't account for the repeated-measures structure
  • Multiple comparisons across channels/frequencies need proper correction

Current problematic code (in stats.py):

# averaging across frequencies (compute stats only in ch space)
power = np.mean(data, axis=2)
T_obs, p_values, H0 = mne.stats.permutation_t_test(power, n_permutations, tail=0)

Tasks:

  1. Analysis & Documentation

    • Document why current approach is problematic
    • Review appropriate alternatives (repeated-measures ANOVA, mixed-effects, cluster-based)
  2. Implementation

    • Implement proper group-level statistics for PSD data
    • Options to consider:
      • Repeated-measures ANOVA (if comparing conditions)
      • Mixed-effects models (for hierarchical data)
      • Non-parametric cluster-based permutation (already partially in HyPyP)
    • Add to stats.py or create new module
  3. Tutorial

    • Create new notebook section or mini-notebook: "Proper Statistics for Hyperscanning"
    • Show correct workflow: epochs → stats (not epochs → average → stats)
    • Include interpretation guidelines

Acceptance Criteria:

  • Document explaining the statistical issue
  • New function(s) in stats.py with proper tests
  • Tutorial notebook demonstrating correct usage
  • Comparison showing difference between old and new approach
  • Docstrings with statistical assumptions clearly stated

References:


Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions