BCompare groups · Guide test 155
Pillai trace MANOVA test
Tests multivariate model effects using a sum of explained canonical variance proportions.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- MANOVA / MANCOVA — Do several outcomes jointly differ across groups (adjusting for covariates)?
In MANOVA / MANCOVA, choose Test statistic = Pillai's trace.
Do it in CodeSplash Run this test on your own data, in Python or R.
Bench
Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.
Bench · Pillai trace MANOVA test
Above 1 the later groups are more spread out (unequal covariance matrices).
Your data
Simulated with known truth3 groups on two measurements; crosses mark the group means.
If H₀ were true
- The reference: how F varies across samples when H₀ is true (F approximation).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .263).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- between-group sums of squares and cross-products
- within-group sums of squares and cross-products
- eigenvalues of E⁻¹H
- the Pillai statistic
The verdict
F(4, 84) = 1.34, p = .263, V = 0.12
p > α = .050: compatible with H₀
Effect size: Pillai's trace V = 0.120
Pillai's trace is the most robust of the four to unequal covariance matrices and non-normality. All four statistics agree when there are two groups.
- Statistic
- 1.337
- p-value
- 0.2631
Pillai trace MANOVA test on 3 groups of 15 rows on two variables: F(4, 84) = 1.34, p = .263, V = 0.12. The p-value is above α = .050, so the data are compatible with H₀.
Question and hypotheses
H0: the specified multivariate contrasts are zero.
Assumptions
Independent multivariate normal errors with a common nonsingular covariance, a correctly specified full rank multivariate linear model, and estimable hypothesis contrasts.
Formula
Parameters and notation
H and E are hypothesis and residual sums-of-squares-and-products matrices. λj are the s=min(p,q) nonzero eigenvalues of E⁻¹H; p outcomes,q hypothesis df,v residual df.
Structure of the method
Fit the multivariate model and sum the canonical variance fractions from H relative to H+E. Each root contribution is bounded, distinguishing Pillai’s aggregate from an unbounded sum of generalized roots or a single largest-root statistic.
Estimated and nuisance parameters
Regression coefficient and common residual covariance matrices are estimated. E and H are fitted cross-product summaries; the number of effective roots follows from response and hypothesis ranks, not from a data-tuned component count.
Settings and design choices
Prespecify multivariate contrasts, response variables, alpha and the reported F approximation. In unbalanced designs, state which hypothesis/sums-of-squares definition is used. Numerical rank tolerance should be reported if it affects estimability.
Fitting and adaptation
Refit the model and canonical decomposition for new observations. Changing responses, covariates or contrasts requires recalculating the hypothesis and residual degrees of freedom, not fine-tuning an old p-value. Report the trace and its calibrated F reference. Follow a prespecified multiplicity strategy if the multivariate result leads to multiple outcome-specific conclusions.
Sensitivity and robustness
Pillai’s criterion is often relatively robust among classical choices, but that is not a guarantee under severe heterogeneity or dependence. Small residual samples and redundant outcomes weaken inference. One-df effects make the classical criteria’s F statistics identical; selecting a preferred criterion after seeing results is unnecessary and potentially misleading.
How to use and calibrate
Let m=(|p−q|−1)/2 and a=(v−p−1)/2. F=[(2a+s+1)/(2m+s+1)]V/(s−V), with df1=s(2m+s+1), df2=s(2a+s+1), is the standard approximation.
Example application
Test a multivariate group effect using a bounded sum of roots.
Interpretation and pitfalls
Watch out
Often comparatively robust among classical MANOVA criteria, but not immune to dependence, severe heterogeneity or design imbalance.
What changed in edition 2
- New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.
Python and R
R selects the named criterion; Python prints all four MANOVA criteria, so read the row matching this entry. Two groups yield only one nonzero latent root.
Validated — Executed successfully in the validation environment · needs numpy, scipy, statsmodels
import numpy as np
from scipy import stats
rng = np.random.default_rng(2026)
X=rng.normal(size=(40,3));Y=rng.normal(.3,1,size=(50,3))
from statsmodels.multivariate.manova import MANOVA
Z=np.vstack([X,Y]);g=np.r_[np.zeros(len(X)),np.ones(len(Y))]
print(MANOVA(Z,np.column_stack([np.ones(len(Z)),g])).mv_test())
Output
Multivariate linear model
============================================================
------------------------------------------------------------
x0 Value Num DF Den DF F Value Pr > F
------------------------------------------------------------
Wilks' lambda 0.9957 3.0000 86.0000 0.1240 0.9457
Pillai's trace 0.0043 3.0000 86.0000 0.1240 0.9457
Hotelling-Lawley trace 0.0043 3.0000 86.0000 0.1240 0.9457
Roy's greatest root 0.0043 3.0000 86.0000 0.1240 0.9457
------------------------------------------------------------
------------------------------------------------------------
x1 Value Num DF Den DF F Value Pr > F
------------------------------------------------------------
Wilks' lambda 0.9185 3.0000 86.0000 2.5421 0.0616
Pillai's trace 0.0815 3.0000 86.0000 2.5421 0.0616
Hotelling-Lawley trace 0.0887 3.0000 86.0000 2.5421 0.0616
Roy's greatest root 0.0887 3.0000 86.0000 2.5421 0.0616
============================================================Validated — Executed successfully in the validation environment · needs Base/standard library
set.seed(2026)
X<-matrix(rnorm(120),ncol=3);Y<-matrix(rnorm(150,mean=.3),ncol=3)
Z<-rbind(X,Y);g<-factor(rep(1:2,c(nrow(X),nrow(Y))));print(summary(manova(Z~g),test="Pillai"))
Output
Df Pillai approx F num Df den Df Pr(>F) g 1 0.21707 7.9481 3 86 9.73e-05 *** Residuals 88 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Sources
- R MANOVA test documentationstat.ethz.ch
- summary.manovastat.ethz.ch
- Statistics guide v4 (historical):
- Python: Executed successfully in the validation environment · R: Executed successfully in the validation environment
- Reference's record:
- Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Unavailable local dependencies: statsmodels. Python: Not run in the reference's review: Unavailable local dependencies: statsmodels. No installation attempted. R: Reviewed but not run: R wasn't available to the reference's authors.
From the CodeSplash statistics guide (v4), entry 155, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT155.