Transform each observation to . If has full row rank , the transformed sample is multivariate normal with mean and positive-definite covariance matrix . Its sample mean is and its unbiased sample covariance matrix is . The Hotelling test of linear hypotheses therefore uses
Here is required. Reject for a large scaled statistic using the relevant upper F-distribution quantile. If the rows of are dependent, choose a basis for their row space, use that basis as the contrast matrix, and replace by its rank . The null hypothesis is unchanged, but redundant contrasts must not be treated as independent dimensions. Rank zero gives no restrictions and hence no nontrivial test.
At equal spacing , the adjacent increments of an affine mean profile are all . Their differences are therefore zero. Define the matrix whose row associated with the interior time has coefficients in columns . Then
Conversely these equations make all adjacent first differences equal, so is affine in , equivalently affine in the equally spaced times. Thus the restriction is exactly , not just a necessary condition. Its null space has basis and , so has rank .
For and , the second-difference test of a linear mean profile is the Hotelling test of linear hypotheses with
Reject the affine-profile hypothesis when the scaled statistic exceeds its level- upper F-distribution critical value. This removes the nuisance intercept and slope without estimating them separately.
For unequal ordered distinct times, put and replace each second-difference row by the adjacent-slope contrast
Its three coefficients are , and . Vanishing means all adjacent slopes agree, again giving null space and rank . Use this new in the same statistic and null distribution. For , every mean profile at distinct times is affine, so there is no lack-of-linearity restriction to test.
At equally spaced distinct times, a mean profile is affine exactly when its consecutive second differences vanish. These form independent contrasts. At unequal times, compare adjacent slopes instead: . A Hotelling test of linear hypotheses tests these restrictions jointly with unknown covariance.