Why Residual Permutations Need Care
Permutation tests are attractive because they can avoid specifying a parametric distribution for a test statistic. In a linear model with nuisance effects, however, the observed response is not just an error vector: it contains a fitted nuisance component. Permuting the raw responses may scramble that component and create a reference distribution for the wrong problem. Residual permutation tries to remove the nuisance fit first, but the residuals themselves are altered by estimating that fit.
The distinction matters especially for a multivariate response. Each observational unit contributes a row of responses, and a permutation should usually move that row as a unit. The method’s calibration then depends on whether the residuals have the required permutation symmetry, or whether the use of fitted residuals is only a large-sample approximation.
Model and the Freedman–Lane Construction
Let \(Y\) be an \(n\times q\) response matrix, with one row per observational unit and \(q\) response variables. Write the full linear model as
Here \(X_0\) is the \(n\times p_0\) nuisance design, \(X_1\) is the \(n\times p_1\) design for the effect of interest, and \(B_0,B_1\) are coefficient matrices. The null hypothesis is \(H_0:B_1=0\). Assume the combined design has the intended rank, and define the reduced model using \(X_0\) alone. Let \(P_0\) be the orthogonal projection onto the column space of \(X_0\), and let \(M_0=I-P_0\). The reduced fitted values and residuals are \(P_0Y\) and \(R_0=M_0Y\).
The observed statistic is computed from \(Y\), and the reference distribution is formed from the statistics computed on the permuted pseudo-responses. For a complete enumeration of a finite permutation group \(\mathcal G\), a common upper-tail p-value is \( |\mathcal G|^{-1}\sum_{\pi\in\mathcal G} I\{T(Y^{(\pi)})\geq T(Y)\}\). If only \(B\) random permutations are drawn, the usual finite-simulation version includes the observed arrangement and uses \((1+\sum_{b=1}^B I\{T(Y^{(b)})\geq T(Y)\})/(B+1)\). These formulas handle ties conservatively when the comparison includes equality.
Worked Example: One Freedman–Lane Permutation
There are four observations and one response, \(Y=(2,4,5,9)^\mathsf{T}\). The reduced model contains an intercept; the full model adds a group indicator for observations 3 and 4. Calculate the observed partial \(F\)-statistic, then one Freedman–Lane replicate that swaps residuals 1 and 4.
Reduced fit. The intercept estimate is the sample mean, \((2+4+5+9)/4=5\). Thus \(P_0Y=(5,5,5,5)^\mathsf{T}\) and \(R_0=(-3,-1,0,4)^\mathsf{T}\).
Observed statistic. The group means are 3 and 7, and the overall mean is 5. The between-group sum of squares is \(2(3-5)^2+2(7-5)^2=16\). The within-group sum of squares is \((2-3)^2+(4-3)^2+(5-7)^2+(9-7)^2=10\). With one numerator and two residual degrees of freedom, \(F=(16/1)/(10/2)=3.2\).
Permuted replicate. Swapping residuals 1 and 4 gives \(P_\pi R_0=(4,-1,0,-3)^\mathsf{T}\), so \(Y^{(\pi)}=(9,4,5,2)^\mathsf{T}\). Its group means are 6.5 and 3.5. The between-group sum of squares is \(2(6.5-5)^2+2(3.5-5)^2=9\); the within-group sum is \(6.25+6.25+2.25+2.25=17\). Hence \(F^{(\pi)}=(9/1)/(17/2)=18/17\), approximately 1.059. This is one member of the permutation reference distribution, not by itself a p-value.
What Is Being Compared?
The residual scheme determines which part of the fitted data is held fixed and which part is rearranged. The table summarizes common choices; their names do not by themselves guarantee valid calibration.
| Scheme | What is permuted or held fixed? | Main concern |
|---|---|---|
| Raw-response permutation | Permute rows of \(Y\) directly | Usually scrambles nuisance structure when the design is fixed |
| Freedman–Lane | Permute reduced-model residual rows and add them to reduced fitted values | Reduced residuals are estimated and generally dependent |
| Full-model residual permutation | Permute residual rows from the full fit and add them to full fitted values | The fit includes the tested effect, which can alter the resampling behavior |
Raw-response permutation is appropriate only when the null distribution is invariant to the proposed row permutations, including the nuisance structure. Full-model residual permutation is a distinct procedure, not another name for Freedman–Lane. Because the full fit has used the effect being tested, its residuals need not represent the null errors in the same way that reduced-model residuals are intended to. Neither alternative should be adopted merely because it is computationally convenient.
Worked Example: Why Multivariate Rows Must Move Together
Suppose three units have two-dimensional responses \(Y=\begin{pmatrix}1&2\\3&0\\5&4\end{pmatrix}\), and the reduced model contains an intercept in each response. Find its fitted values and residual rows, then compare a row permutation with separate permutations of the two response columns.
The column means are 3 and 2, so every fitted row is \((3,2)\). The residual rows are \((-2,0),(0,-2),(2,2)\). Swapping the first and third rows gives residuals \((2,2),(0,-2),(-2,0)\), and the Freedman–Lane pseudo-response is \(\begin{pmatrix}5&4\\3&0\\1&2\end{pmatrix}\).
The residual cross-product between the two response coordinates is \((-2)(0)+(0)(-2)+(2)(2)=4\). If the first-coordinate residuals stay in order but the second-coordinate residuals are reordered to \((2,0,-2)\), the cross-product becomes \((-2)(2)+(0)(0)+(2)(-2)=-8\). Separate column permutations have changed the observed pairing of responses across units. A row permutation preserves each multivariate residual vector and is the relevant operation when units, rather than response coordinates, are exchangeable.
When Is Residual Permutation Exact?
A finite-sample exact permutation test needs a genuine symmetry under the null. The following sufficient condition makes precise one setting where Freedman–Lane has that symmetry. A permutation group \(\mathcal G\) is a collection of permutation matrices closed under composition and inverse. Assume the error matrix is invariant in distribution under every allowed permutation: \(P_\pi E\overset{d}=E\). Independent, identically distributed error rows are a familiar sufficient condition.
Proof. The column-space condition implies that \(P_\pi P_0=P_0P_\pi\), and therefore \(P_\pi M_0=M_0P_\pi\). Under the null, \(Y=X_0B_0+E\), so \(R_0=M_0E\). For each allowed permutation, \(P_\pi R_0=P_\pi M_0E=M_0P_\pi E\overset{d}=M_0E=R_0\). Thus the reduced residual matrix is invariant in distribution under the group. The test statistic is unchanged by the nuisance fitted term \(P_0Y\), since that term lies in the column space of \(X_0\). Consequently the observed statistic and the statistics over the permutation orbit are governed by the same group symmetry. Under a finite group, an invariant distribution assigns equal probability to arrangements within each orbit, so the rank of the observed statistic among its orbit values is uniform in the absence of ties and conservative when ties are counted in the upper tail. This gives the stated level bound. \(\square\)
The condition is sufficient, not necessary. With an intercept-only nuisance design, every row permutation preserves the nuisance column space, so iid error rows give this symmetry. For a general covariate design, most permutations do not preserve its column space, and the theorem does not establish exactness.
Worked Example: Checking the Symmetry Condition
Compare an intercept-only nuisance design with a nuisance design containing an intercept and \(x=(0,1,2,3)^\mathsf{T}\). Consider swapping the first two observations.
Intercept only. The nuisance space is the span of \((1,1,1,1)^\mathsf{T}\). Any row permutation leaves this vector unchanged, so every permutation preserves the nuisance space. With permutation-invariant error rows, the theorem’s exactness condition holds for a statistic that is invariant to the intercept.
Intercept and covariate. The nuisance space is the span of \(\mathbf 1\) and \(x\). Swapping the first two entries of \(x\) gives \((1,0,2,3)^\mathsf{T}\). If this were \(a\mathbf 1+bx\), its first two entries would require \(a=1\) and \(a+b=0\), giving \(b=-1\). Its third entry would then be \(a+2b=-1\), not 2. The permuted covariate is therefore not in the nuisance space, so this swap violates the theorem’s design condition. Even if the underlying errors are iid, exactness does not follow from that theorem.
Why Calibration Is Often Approximate
For a general nuisance design, reduced residuals are projected errors, not the original errors. Under independent rows with common covariance matrix \(\Sigma\), their covariance across observational units is \(\operatorname{Cov}(R_{0,i\cdot},R_{0,j\cdot})=(M_0)_{ij}\Sigma\). Unless \(M_0\) has the symmetry required by the allowed permutations, the residual rows are not exchangeable. A permutation of them then creates a reference distribution that does not have the exact finite-sample null law.
There is a useful approximation argument, but it is not an automatic validity theorem. If the nuisance design has fixed rank \(r\), the error rows are independent with mean zero and covariance \(\Sigma\), then
Indeed, the expectation is \(\operatorname{tr}(\Sigma)\operatorname{tr}(P_0)/n\), and \(\operatorname{tr}(P_0)=r\). If \(r\) stays fixed as \(n\) grows, this quantity tends to zero. Thus projection changes the errors by a vanishing amount on average squared per observation. This helps explain why residual permutations can work approximately in some large samples, especially with low-dimensional nuisance fits and suitably regular, studentized statistics. It does not prove that a particular permutation test is asymptotically valid: leverage, design imbalance, heteroscedasticity, dependence, and the statistic’s behavior all matter.
For an error distribution invariant under row permutations, iid rows are a standard assumption; equal means and covariances alone are not enough. If row distributions differ, or if errors are dependent, unrestricted residual permutations generally lack the needed symmetry. More specialized permutation restrictions require a design-specific justification and should not be inferred from the Freedman–Lane formula alone.
Common Mistake
The practical value of the distinction is substantial. A well-chosen residual scheme can protect the nuisance fit while allowing a flexible statistic and a data-driven reference distribution. But reporting a permutation p-value does not, by itself, establish that the p-value is exact. State which residuals were permuted, whether whole response rows moved together, what assumptions were made about the errors, and whether calibration is exact or approximate under those assumptions.
Check Your Understanding
Use the model, permutation, and symmetry conditions introduced above to answer these questions.
- Write the Freedman–Lane pseudo-response in terms of \(P_0\), \(M_0\), \(Y\), and a permutation matrix.
- Why can raw-response permutation be inappropriate when a fixed nuisance covariate is present?
- State the two main symmetry conditions in the finite-sample exactness theorem.
- Why should a multivariate residual permutation ordinarily move whole rows rather than permute each response column independently?
- For a fixed-rank nuisance design, what does \(E[\|P_0E\|_F^2/n]\) say about the residuals, and what does it not establish?