Multi-factor repeated-measures designs#

In spm1d 0.5 the covariance corrections described in Unequal variances and Non-sphericity do not apply to the multi-factor repeated-measures procedures: anova2rm, anova2onerm, anova3rm, anova3onerm and anova3tworm. This page explains what those procedures assume and why these corrections are not yet implemented for these procedures in version 0.5.

Covariance corrections in version 0.5#

In spm1d 0.5 cov_model='unstructured' is used as default in between-subjects designs (ttest2, anova1, etc.), yielding one error variance term per design cell and the Satterthwaite ν. For one-way repeated-measures ANOVA (anova1rm), cov_model='unstructured' estimates the full within-subject covariance, where the Satterthwaite ν reproduces the Greenhouse–Geisser ν. In both cases the error term is estimated by restricted maximum likelihood (REML).

Limitations for multi-factor repeated-measures designs#

spm1d’s multi-factor repeated-measures procedures (anova2onerm, anova3onerm, etc.) follow classical procedures. Each within-subject effect is tested against its own error stratum (the subject-by-effect interaction), and between-subject effects are tested against the subject stratum. There is no correction for a statistic that is tested against a stratum, so these procedures therefore accept cov_model='iid' only (default for these procedures). Requesting cov_model='unstructured' for these procedures raises an SPM1DError.

For multi-factor repeated-measures designs this implies:

  • Sphericity is assumed for every within-subject effect. In version 0.5 Mauchly’s test of sphericity (see Non-sphericity) is available, but only as a diagnostic.

  • In spm1d’s mixed designs, equal within-subject covariance across the between-subject groups is assumed. The between-subject effects assume equal variances across groups. Similar to Mauchly’s test, Box’s M test (see Unequal variances) is also available only as a diagnostic.

  • Permutation inference in spm1d v0.5 does not overcome these limitations because within-subject permutation assumes exchangeability, but non-sphericity violates this assumption.

Users who observe strong non-sphericity and seek corrections in version 0.5 have three options:

  • Reduce analysis to one-way repeated-measures ANOVA (i.e., spm1d.stats.anova1rm).

  • Confine analyses to two-level within-subject factors, where data are spherical by definition.

  • Use multi-factor results, report possible violations of sphericity assumption, acknowledge version 0.5’s lack of correction for multi-factor designs, and interpret results cautiously.

Roadmap#

Full within-subject covariance models for these designs via a single error term are planned for spm1d 0.6. Preliminary parametric corrections have been implemented, and nonparametric inference procedures that restore exchangeability under non-sphericity are similarly implemented, but verifying the performance of these corrections represents a substantial simulation effort to adequately map the corrections’ performances across various experimental and data scenarios. This will take thousands of hours of simulation and refinement, so we thank you for your patience while these are developed.