This is a major release with many bugfixes, several of which silently returned incorrect results. We strongly recommend all users upgrade. It also brings new features, large speed improvements, and new minimum versions for Python and all dependencies.
Bugfixes — incorrect results
mixed_anova: the Greenhouse-Geisser corrected p-value of the within factor did not match the F-value and degrees of freedom on the same row, and epsilon and Mauchly's test were computed from the total covariance matrix instead of the pooled within-group covariance. All values now match R, SPSS and JASP, and the interaction also gets a corrected p-value. Reportedeps,W_spher,p_spherandp_GG_corrchange whenever group means differ across levels of the within factor. (#525)epsilon,sphericityandrm_anova: fixed the epsilon of the interaction in two-way repeated measures designs where both factors have more than 2 levels. Mauchly's test for the interaction is now supported and is reported for all effects in two-wayrm_anova. (#527, #528)sphericity: the John, Nagao and Sugiura (method="jns") test statistic was inverted, so sphericity was rejected in 100% of simulations under the null hypothesis (now ~5%). (#531)linear_regression: standard errors and p-values depended on the scale of the predictors. For example, multiplying a predictor by 1e-8 changed its p-value from 0.35 to 0. The same issue was fixed inlogistic_regression, as well as in the LMG relative importance (relimp=True), which no longer summed to the model's R² for small-scale predictors. (#520, #523, #540)rcorr: withpadjust, the diagonal and lower triangle of the matrix were included as fictitious zero p-values in the multiple comparison correction, making FDR correction severely liberal. (#521)ptests: thepadjustargument was ignored, and the Bonferroni correction was always applied. (#536)anovaandancova: unused levels of a categorical factor silently corrupted the SS, DF and F-values.anovanow also raises aValueErrorwhen a combination of the between-subject factors has no observation, which previously returned a negative SS and F for the interaction. (#529, #531)corrandpairwise_corr: one-sided p-values of the Kendall correlation used the Pearson t-approximation instead of the exact test. (#534)compute_effsize: one-sample effect sizes (scalary) ignoredeftypeand always returned Cohen's d. (#534)power_anovaandpower_rm_anova: solving for the effect size returned NaN whenever eta-squared was above 0.5. (#534)pairwise_tests: when a global rounding option was set, all pairs but the first were rounded before the multiple comparison correction, giving wrongp_corr. More generally, rounding options no longer leak into internal computations in any function. (#536)mediation_analysis: a binary mediator was fitted with a linear model whenever another mediator was continuous. (#531)chi2_independence: rows with missing values were counted in the sample size (wrong Cramer's V and power), and Yates' correction over-corrected cells close to the expected count. (#537)circ_rayleighandcirc_vtest: missing angles were counted in the sample size. (#537)logistic_regression: estimates were not fully converged with the default solver (off in the 3rd-4th decimal). They now match Rglmand statsmodels to about 6 digits. (#526)welch_anovadid not drop missing values (slightly wrongnp2), andhomoscedasticityreturned NaN when a sample had missing values. (#529, #531)qqplot: the data were not standardized when only one oflocorscalediffered from the default. (#513)
Bugfixes — security, crashes and edge cases
ancova,anova(unbalanced or 3+ factors) andplot_rm_corr: column names were inserted in a patsy formula and evaluated as Python code. Column names with quotes, commas, parentheses, or integer names now also work. (#537)distance_corr: permutation p-values depended on the platform. (#526)- Fixed crashes in
ttestwith a non-boolpaired(e.g.np.True_),logistic_regressionwithfit_intercept=False,homoscedasticity(Bartlett) with integer data,chi2_mcnemarwhen every subject switched, andpairwise_corrwith mixed-type column labels. NumPy scalars and unsigned integer data are now accepted everywhere. (#526, #529, #531, #536, #537) plot_paired: the boxplot transparency was silently ignored with recent versions of matplotlib. (#513)
New features
pairwise_tukeyandpairwise_gameshowellnow accept a list of between-subject factors, in which case all pairs of cells of the interaction are compared. This is equivalent to R'sTukeyHSD(aov(dv ~ A * B), which = "A:B"). (#539)rm_anovanow reports Mauchly's test of sphericity (sphericity,W_spher,p_spher) for two-way designs, andsphericitynow supports two within-subject factors with more than 2 levels each. (#527, #528)plot_blandaltman: newpercentageparameter to express the differences as a percentage of the mean, and newsymmetric_ylimparameter.qqplot: newline_kwargsandci_kwargsparameters to customize the fit line and confidence envelope. (#513)pairwise_gameshowellcan now be used as apandas.DataFramemethod. (#536)
Improvements
Many functions are now substantially faster, with identical outputs. Timings below compare v0.6.1 and v0.7.0 on an Apple M1 Max:
linear_regression: 209 ms → 128 ms with n = 1,000,000 and 10 predictors. Withrelimp=True: 6.09 s → 0.11 s (55x) with 12 predictors. Withweights: 16 ms → 1 ms with n = 5,000, and a dense (n, n) matrix is no longer allocated (3.2 GB at n = 20,000). (#531, #540)compute_effsizewitheftype="cles": 738 ms → 4.2 ms (175x) with 20,000 observations per group, and ~3 GB less memory. (#534)bayesfactor_binomuses the exact beta-binomial distribution instead of numerical integration: 100x faster. (#537)rcorr: 176 ms → 13 ms (13x) with 60 columns.ptests: 61 ms → 4 ms (15x) with 20 columns. (#534, #536)compute_bootci: statistics that accept anaxisargument (e.g.numpy.mean) are now vectorized across all bootstrap samples: 54 ms → 19 ms withfunc=np.meanand 10,000 bootstrap samples. (#538)- The formatting of the output dataframe, which runs at the end of every function, is about 20x faster on a 500 × 14 table. (#537)
- All docstring examples are now tested in the CI. (#526)
Breaking changes
linear_regressionno longer removes duplicate, all-zero or extra constant columns fromX. The output keeps one row per input column, a rank-deficiency warning is emitted, and the collinear coefficients are the minimum-norm solution, as in statsmodels. (#540)logistic_regressionwithfit_intercept=Falseno longer removes the first non-zero constant column ofX, which is the only intercept of the model in that case. (#541)- The deprecated
gzscorefunction has been removed. Usescipy.stats.gzscoreinstead. (#541) - Circular functions now raise a
ValueErrorwhen the angles are not all in [-π, π] or all in [0, 2π], i.e. when they are likely expressed in degrees. (#537) convert_effsizeandcompute_effsize_from_tnow raise aValueErrorfor'cohen_dz'and'cles', which previously returned incorrect values. (#534)- Some input checks in the plotting functions now raise
ValueErrororTypeErrorinstead ofAssertionError. (#513)
Dependency requirements
This version drops support for Python 3.10 and NumPy 1.x (#535). It requires Python >= 3.11 (Python 3.11-3.14 are supported) and:
- NumPy >= 2.2.2
- SciPy >= 1.15.0
- Pandas >= 2.3.0
- Statsmodels >= 0.14.5
- Scikit-learn >= 1.6.1
- Matplotlib >= 3.10.1
- Seaborn >= 0.13.2
See the documentation changelog for previous releases.
What's Changed
- Plotting improvements by @raphaelvallat in #513
- Fix scale-dependent standard errors and p-values in linear regression by @dnncha in #520
- Fix rcorr multiple-testing family by excluding matrix placeholders by @dnncha in #521
- Fix docstring examples and run doctests in CI by @raphaelvallat in #526
- Fix sphericity correction in mixed_anova by @raphaelvallat in #525
- Fix epsilon and sphericity for two-way repeated measures interactions by @raphaelvallat in #527
- Report Mauchly's test of sphericity in two-way rm_anova by @raphaelvallat in #528
- Fix edge cases in ttest, two-way anova and welch_anova by @raphaelvallat in #529
- Compute LMG relative importance on the correlation matrix by @shaneraphel in #523
- Fix bugs and speed up regression, ANOVA and distribution functions by @raphaelvallat in #531
- Refactor repeated measures ANOVAs, anova2 and regression input checks by @raphaelvallat in #532
- Fix bugs and simplify correlation, power and effect size functions by @raphaelvallat in #534
- Bump minimum dependencies to 2025+ releases and Python 3.11 by @raphaelvallat in #535
- Simplify pairwise and multicomp functions and fix rounding bugs by @raphaelvallat in #536
- Fix bugs and simplify utils, contingency, circular, bayesian and plotting by @raphaelvallat in #537
- Speed up CI and the slowest unit tests by @raphaelvallat in #538
- Support interactions of several factors in pairwise_tukey and pairwise_gameshowell by @raphaelvallat in #539
- Fix numerical and performance issues in linear and logistic regression by @raphaelvallat in #540
- Remove gzscore and keep the constant column in logistic_regression with fit_intercept=False by @raphaelvallat in #541
New Contributors
- @dnncha made their first contribution in #520
- @shaneraphel made their first contribution in #523
Full Changelog: v0.6.1...v0.7.0