Skip to content

Conversation

@mariam851
Copy link

@mariam851 mariam851 commented Jan 10, 2026

Hi @raphaelvallat,

Description

This PR addresses Issue #19 by implementing the Greenhouse-Geisser epsilon calculation for the interaction term in rm_anova2. Previously, the interaction epsilon was not supported and often defaulted to 1.0 or caused issues in certain datasets.

Changes

  • Interaction Epsilon: Implemented using orthonormal Helmert contrasts via patsy to ensure consistency with JASP and R (ezANOVA).
  • Cleanup: Removed deprecated comments regarding the lack of support for interaction epsilon.

@raphaelvallat
Copy link
Owner

Hi @mariam851,

Thank you for opening the issue and addressing this long-standing issue ! A few requests:

  • Could you upgrade from patsy to formulaic? The former has been deprecated since 2021. This'll be helpful because I've been wanting to update some of the core regression/ANOVA functions in Pingouin with formulaic (instead of pure numpy/pandas).
  • You will need to add formulaic to the pyproject.toml dependencies
  • Can you please add some unit tests against JASP or R in test_rm_anova2?

Thanks,
Raphael

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.54%. Comparing base (cfaa5db) to head (b3e64e8).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #484   +/-   ##
=======================================
  Coverage   98.54%   98.54%           
=======================================
  Files          19       19           
  Lines        3362     3363    +1     
  Branches      493      493           
=======================================
+ Hits         3313     3314    +1     
  Misses         26       26           
  Partials       23       23           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mariam851
Copy link
Author

mariam851 commented Jan 20, 2026

Hi @raphaelvallat,

I've updated the PR to fix the interaction epsilon in rm_anova2.

The fix: I replaced the formulaic approach with a direct pivot_table(columns=[within_a, within_b]). This ensures the epsilon function receives the correct wide-format data, fixing the GG epsilon (now correctly returns 0.727 instead of 0.96/1.0).

CI Failures Note: The current failures in test_corr, test_friedman, and test_ttest are unrelated to my changes. They exist in the master branch due to recent dependency updates (e.g., the AttributeError in SciPy).

The code has been formatted with ruff and is ready for review.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants