Tutorials › Multivariate Statistics (Graduate) › Testing Profile Flatness

Contrasts and Repeated Measures · Tutorial 366 of 975

Testing Profile Flatness

Use occasion contrasts to test whether every group has a constant mean profile, and distinguish that null hypothesis from equality of profile shapes.

Advanced 10 min read

What You'll Learn

  • Express profile flatness as zero within-group occasion contrasts.
  • Choose a full-rank contrast basis for the constant-profile null space.
  • Construct the hypothesis and residual sum-of-products matrices for a MANOVA test.
  • State the normality, covariance, and sample-size conditions for the exact test.
  • Distinguish flatness from parallelism with examples.
  • Interpret a significant flatness test in the original occasion scale.

Why Flatness Is a Distinct Profile Hypothesis

A group can have the same mean response at every occasion, or its mean can rise and fall over occasions. The question of profile flatness asks whether the first description holds separately for every group. It is not the same as asking whether groups have the same profile shape: several groups can rise by the same amount at each occasion and therefore be parallel without being flat.

The useful move is to replace each response vector by its within-subject occasion contrasts. A constant mean profile has zero value on every such contrast. This turns a statement about repeated occasion means into a multivariate mean hypothesis, which can be tested using the MANOVA framework.

Definition: Suppose there are \(G\) groups and \(p\) occasions. Let \(\mu_g\) be the \(p\)-component vector of population mean responses for group \(g\). The profiles are flat if, for each group \(g\), all \(p\) entries of \(\mu_g\) are equal. Equivalently, \(\mu_g=\alpha_g\mathbf{1}_p\) for some scalar \(\alpha_g\), where \(\mathbf{1}_p\) is the \(p\)-vector of ones.

Writing Flatness as a Contrast Hypothesis

Let \(C\) be a \(p\times q\) matrix of full column rank whose columns are occasion contrasts: \(C'\mathbf{1}_p=0\). For a complete basis of the occasion-contrast space, \(q=p-1\). If \(Y_{ig}\) is the response vector for subject \(i\) in group \(g\), define the transformed response \(Z_{ig}=C'Y_{ig}\), with mean \(\eta_g=C'\mu_g\). The test of flatness is

$$ H_0:\ \eta_1=\eta_2=\cdots=\eta_G=0 \qquad\text{against}\qquad H_A:\ \text{at least one }\eta_g\ne 0. $$

The contrast basis can be chosen in different ways. For example, adjacent differences detect changes between neighboring occasions. What matters is that the columns span the whole space perpendicular to \(\mathbf{1}_p\); otherwise, a nonconstant profile could escape detection.

Result: If \(C\) has rank \(p-1\) and \(C'\mathbf{1}_p=0\), then \(C'\mu_g=0\) if and only if \(\mu_g\) is constant across occasions.

To verify the result, \(C'\mathbf{1}_p=0\) shows that every constant vector \(\alpha_g\mathbf{1}_p\) has zero contrasts. Conversely, the null space of \(C'\) has dimension \(p-(p-1)=1\). It contains \(\mathbf{1}_p\), so it consists exactly of the multiples of \(\mathbf{1}_p\). Thus \(C'\mu_g=0\) forces \(\mu_g=\alpha_g\mathbf{1}_p\). This also explains why a complete contrast basis is needed.

Worked Example: Contrasts Identify Flat and Nonflat Profiles

Suppose there are three occasions and use the two adjacent contrasts \(C'=\begin{pmatrix}-1&1&0\\0&-1&1\end{pmatrix}\). For a group with mean profile \(\mu=(4,4,4)'\), calculate \(C'\mu\).

The first contrast is \(-4+4=0\), and the second is \(-4+4=0\). Thus \(C'\mu=(0,0)'\), as required for a flat profile.

For \(\mu=(2,4,6)'\), the contrasts are \(-2+4=2\) and \(-4+6=2\), so \(C'\mu=(2,2)'\). Since this is not zero, the profile is not flat. Both contrasts are needed: a profile can change between occasions in more than one way, and flatness requires every independent occasion contrast to vanish.

Testing the Hypothesis with MANOVA

For an exact classical test, assume subjects are independent, and within each group the response vectors are multivariate normal with a common positive-definite covariance matrix \(\Sigma\). Group sizes \(n_g\) may differ; write \(N=\sum_{g=1}^G n_g\). Under the contrast transformation, the covariance matrix is \(\Omega=C'\Sigma C\), which is positive definite because \(C\) has full column rank. The transformed observations in each group have mean \(\eta_g\) and common covariance \(\Omega\).

Write \(\bar Z_g\) for the sample mean transformed response in group \(g\). The hypothesis sum-of-products matrix for testing that every group mean is zero, and the within-group residual sum-of-products matrix, are

$$ H=\sum_{g=1}^G n_g\bar Z_g\bar Z_g', \qquad E=\sum_{g=1}^G\sum_{i=1}^{n_g}(Z_{ig}-\bar Z_g)(Z_{ig}-\bar Z_g)'. $$

Here \(H\) measures the transformed group means relative to zero, not their differences from one another. The matrix \(E\) estimates the common within-group covariance up to its degrees of freedom. A standard MANOVA criterion, such as Wilks' lambda \(\Lambda=|E|/|E+H|\), tests the joint null. For \(q=1\), this reduces to the familiar exact \(F\)-test for all \(G\) group means being zero.

Theorem: Under the independent multivariate normal, common-covariance model just stated, under \(H_0\), \(H\) and \(E\) are independent Wishart matrices with common scale \(\Omega\) and degrees of freedom \(G\) and \(N-G\), respectively. If \(N-G\ge q\), \(E\) is nonsingular with probability one, so the usual MANOVA criteria are defined.

For the justification, form the \(n_g\times q\) data matrix for each group. Its rows have mean \(\eta_g'\) and covariance \(\Omega\). Under \(H_0\), multiplying that matrix by the normalized vector \(n_g^{-1/2}\mathbf{1}_{n_g}\) gives \(\sqrt{n_g}\bar Z_g'\), a mean-zero multivariate normal vector with covariance \(\Omega\). The squared outer products of these \(G\) independent vectors sum to \(H\), giving the stated Wishart distribution with \(G\) degrees of freedom.

Within group \(g\), the centering matrix \(I_{n_g}-n_g^{-1}\mathbf{1}_{n_g}\mathbf{1}_{n_g}'\) is a symmetric projection of rank \(n_g-1\). It produces the residual cross-products for that group. The mean direction and the centered residual directions are orthogonal. For multivariate normal observations, orthogonal projections of the data are independent; hence the group mean contribution and residual contribution are independent. Summing the independent group residual contributions gives \(E\) with \(\sum_g(n_g-1)=N-G\) degrees of freedom. The same orthogonality gives independence of \(H\) and \(E\). Finally, the normal-theory rank property of a Wishart matrix with positive-definite scale gives nonsingular \(E\) when its degrees of freedom are at least \(q\). \(\square\)

Worked Example: Exact Flatness Test with Two Occasions

There are two groups with four subjects each and two occasions. Let the contrast be \(Z=Y_1-Y_2\). The observed contrasts are \(1,2,3,2\) in group 1 and \(-1,0,1,0\) in group 2. Test whether both groups have flat mean profiles, using the pooled-variance \(F\)-test.

The group means are \(\bar Z_1=(1+2+3+2)/4=2\) and \(\bar Z_2=(-1+0+1+0)/4=0\). The hypothesis sum of squares is \(H=4(2^2)+4(0^2)=16\).

For group 1 the residual sum of squares is \((1-2)^2+(2-2)^2+(3-2)^2+(2-2)^2=2\). For group 2 it is \((-1-0)^2+(0-0)^2+(1-0)^2+(0-0)^2=2\). Thus \(E=2+2=4\), with \(N-G=8-2=6\) residual degrees of freedom. The numerator has \(G=2\) degrees of freedom, so

$$ F=\frac{H/G}{E/(N-G)} =\frac{16/2}{4/6} =\frac{8}{2/3} =12. $$

Under the null and the stated normal, common-variance assumptions, this has an \(F_{2,6}\) distribution. The test is of both transformed group means being zero. It is not a test that the two groups have equal mean differences.

Flatness Is Not Parallelism

Using the same contrast matrix in every group, parallelism asks whether groups have the same contrast vector: \(C'\mu_1=\cdots=C'\mu_G\). Flatness instead requires \(C'\mu_g=0\) for every group. Thus flatness implies parallelism, but parallelism does not imply flatness. This distinction is important because the parallel profiles may all change over time.

Worked Example: Parallel Profiles That Are Not Flat

Consider two three-occasion group mean profiles, \(\mu_1=(2,4,6)'\) and \(\mu_2=(5,7,9)'\), with the adjacent contrasts used earlier. The contrast vectors are \(C'\mu_1=(2,2)'\) and \(C'\mu_2=(2,2)'\). They are equal, so the profiles are parallel. But neither vector is zero, so neither profile is flat.

If instead the profiles are \((2,2,2)'\) and \((5,5,5)'\), both contrast vectors are zero. Both profiles are flat and, as a consequence, parallel. Their different overall levels do not prevent flatness.

Common Mistake and Practical Interpretation

A common mistake is to test whether groups have equal occasion contrasts and then call a nonsignificant result evidence of flatness. That reasoning tests parallelism: it allows all groups to share a nonzero contrast vector. The correction is to test each group's transformed mean against zero jointly. Conversely, a test of flatness does not ask whether group levels are equal; each group has its own unrestricted constant level under the flatness null.

The test is meaningful only in relation to its assumptions and design. In the exact MANOVA formulation, the repeated response vectors must be independent across subjects, multivariate normal within groups, and have a common covariance matrix; the residual matrix must also have enough degrees of freedom to estimate a nonsingular covariance. If these conditions are not credible, the stated exact reference distribution need not apply. A rejection says that at least one group has a nonzero occasion contrast, not which group or which occasions account for the departure. A failure to reject is not proof that every population profile is exactly constant.

Key takeaway: Choose a full basis of within-group occasion contrasts and test the transformed mean vector against zero in every group. Equal nonzero contrast vectors indicate parallel, changing profiles—not flat profiles.

Check Your Understanding

Answer each question by referring to the contrast hypothesis, not just to the original profile shapes.

  1. For three occasions, why must a complete flatness test use two linearly independent contrasts?
  2. Profiles \((3,5,7)'\) and \((6,8,10)'\) have the same adjacent contrasts. Are they flat, parallel, both, or neither?
  3. What null hypothesis is tested by \(H=\sum_g n_g\bar Z_g\bar Z_g'\)?
  4. In the two-occasion example, why does the numerator have two degrees of freedom rather than one?
  5. Does rejecting flatness establish that all groups are nonflat? Explain.
Clinical Biostats