**This page was adapted from a web page at the SPSS web page.
We thank SPSS for their permission to adapt and distribute this page via our web site.**

**This page was originally a series of 3 articles
that appeared in SPSS Keywords.**

**INTERPRETING MANOVA PARAMETER ESTIMATES
David P. Nichols
Senior Support Statistician
SPSS, Inc.
From SPSS Keywords, February 1993**

MANOVA is only one of a number of SPSS procedures in which categorical independent variables (factors) are handled automatically by the procedure via creation of sets of contrast variables. Because what a procedure needs in terms of raw variable codings are not always the same as the resulting contrasts these raw variable codings produce, the design information produced sometimes confuses users when they attempt to interpret the parameter estimates. The purpose of this article is to clarify the default procedure by which MANOVA estimates parameters.

Let’s consider an example in which we have two factors, A with two levels, and B with three levels. The following commands submitted to MANOVA request a full factorial analysis of the 2 by 3 design:

MANOVA Y BY A(1,2) B(1,3) /PRINT=DESIGN(ONEWAY OVERALL) PARAM /OMEANS TABLES(CONSTANT, A, B, A BY B) /DESIGN=CONSTANT, A, B, A BY B.

The PRINT subcommand requests MANOVA to provide us with the ONEWAY and OVERALL DESIGN or basis matrices, as well as the parameter estimates. The OMEANS subcommand requests the grand mean, A and B marginal means, and the mean for each cell. The DESIGN subcommand explicitly requests that the test of significance and parameter estimate for the CONSTANT be included on our printout. While these are not printed by default (except with SPSS/PC+), they are included in the model unless NOCONSTANT is requested on the METHOD subcommand.

The omission of any CONTRAST subcommands means that MANOVA will fit the default DEVIATION contrasts for both factors. These contrasts compare all but one of the levels of a factor against the remaining categories. This is equivalent to comparing each level to the mean of all categories. One category is left out (the reference category) because to include it would produce a redundancy in the set of contrasts (recall that with K levels to a factor, there are K-1 degrees of freedom for fitting contrasts). By default, the last category is the reference category.

The first thing that MANOVA will print out for us are the tables of "Combined Observed Means" for the CONSTANT, A, B and A BY B, as requested on the OMEANS subcommand. These appear as:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Combined Observed Grand Means Variable .. Y1 GMEAN WGT. 5.94737 UNWGT. 6.00000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Combined Observed Means for A Variable .. Y1 A 1 WGT. 5.10000 UNWGT. 5.00000 2 WGT. 6.88889 UNWGT. 7.00000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Combined Observed Means for B Variable .. Y1 B 1 WGT. 6.66667 UNWGT. 7.00000 2 WGT. 5.50000 UNWGT. 5.50000 3 WGT. 5.71429 UNWGT. 5.50000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Combined Observed Means for A BY B Variable .. Y1 A 1 2 B 1 WGT. 6.00000 8.00000 UNWGT. 6.00000 8.00000 2 WGT. 5.00000 6.00000 UNWGT. 5.00000 6.00000 3 WGT. 4.00000 7.00000 UNWGT. 4.00000 7.00000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note that there are two sets of means here, weighted and unweighted. These will always be the same for terms representing individual cell means (the A BY B term here) and will also be the same for marginal and grand means if there are the same number of observations in each cell of the design. If the design has different numbers of observations in the cells, the weighted and unweighted versions of all marginals and the grand mean will generally not be the same. The weighted means weight each cell by the number of observations in it, while the unweighted means are simple means of cell means. Our focus here will be on the unweighted means, since these are what MANOVA uses in parameter estimation.

To illustrate how these are calculated, we can see that the first level marginal mean of A is given by:

_ __ __ __ A = (AB + AB + AB ) / 3 = ( 6 + 5 + 4 ) / 3 = 5 . 1 11 12 13 The second level mean is: _ A = ( 8 + 6 + 7 ) / 3 = 7 . 2 The B means are: _ __ __ B = (AB + AB ) / 2 = ( 6 + 8 ) / 2 = 7 , 1 11 21 _ _ B = ( 5 + 6 ) / 2 = 5.5 and B = ( 4 + 7 ) / 2 = 5.5 . 2 3The grand mean is simply the unweighted average of the six cell means, which is the same as the unweighted average of each set of marginal means:__ __ __ __ __ __ __ AB = ( AB + AB + AB + AB + AB + AB ) / 6 = 11 12 13 21 22 23 _ _ _ _ _ ( A + A ) / 2 = ( B + B + B ) / 3 = 6 . 1 2 1 2 3Now let us see how MANOVA goes about comparing these means. Take the case of the two level factor A. The contrast can be written in two equivalent ways:_ _ 1 _ _ CONTRAST A = A - A = - ( A - A ) 1 1 2 1 2

While the first is the more intuitive, as it shows that the contrast simply compares the first level of A to the overall A mean, the second expression is easier to use computationally, as it involves only A marginal means. If we express this contrast as a row vector of contrast coefficients, it becomes simply [ 1/2 -1/2 ]. If we add on an expression for a constant term, we have a full contrast matrix for factor A:

_ _ _1_ | 1 1 | 2 |_ 1 -1 _|

If we were to explicitly request DEVIATION contrasts via input of a SPECIAL contrast matrix, this is what we would specify (actually, MANOVA does not allow fractions or factoring out of a term of a contrast matrix, but here we are using the form that is easiest to see in terms of the requested contrasts). Experienced MANOVA users might recall that the CONSTANT row is often specified as all ones, rather than the .5 or 1/2 used here. MANOVA internally converts this to an average, so that the mean of the means is estimated as opposed to the sum of the means.

After showing us the means, MANOVA next prints out the ONEWAY design or basis matrix for each factor. For A, this appears as:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - One-way Basis for factor A 1 2 1 1.000 1.000 2 1.000 -1.000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Many MANOVA users mistake this matrix for the contrast matrix for factor A, which it is not. It is, however, related to the contrast matrix in the following manner: If the contrast matrix is C, and the basis matrix is X,

-1 C = ( X ' X ) X ' .

This relationship results from the well known expression for least squares estimates of parameters in a linear model:

^ -1 B = ( X ' X ) X ' Y .

There is also a way to calculate X from C:

-1 X = C ' ( C C ' ) .

Since users are generally interested in being certain that they know what contrasts are being fitted, interest generally revolves around C. However, MANOVA does not have to form C explicitly in order to produce parameter estimates and significance tests. The optional CHOLESKY method decomposes X ‘ X and the default QR method decomposes X directly. C is never explicitly formed unless input as a SPECIAL contrast matrix by the user. This is why there is no option to print out the actual contrast matrix.

The above equations for C and X can be used in the SPSS MATRIX procedure (not available for SPSS/PC+) to ensure that the desired matrix has been specified. In most cases there are also simpler ways to confirm the specifications. If a contrast matrix is partitioned into a row for the constant and the remaining rows for the factor effect, and the columns of the basis matrix are similarly partitioned, the following features can be observed: The effect row(s) of an orthonormal contrast matrix are the same as the transpose of the effect column(s) of the corresponding basis matrix. Also, two important types of nonorthogonal contrasts, DEVIATION and SIMPLE, are mirror images of each other. That is, the basis matrix for DEVIATION contrasts is the transpose of the contrast matrix for SIMPLE contrasts, and vice versa.

This can be seen by comparing the basis matrix for A with a SIMPLE contrast matrix for a two level factor. Recall that SIMPLE contrasts compare each level of a factor except a reference category (or baseline) to that reference category. A SIMPLE contrast matrix for a two level factor would thus look like:

_ _ | .5 .5 | |_ 1 -1 _|

As is easily seen, the nonconstant row here is the transpose of the nonconstant column in the basis matrix for A. The same thing is true of the basis and contrast matrices for factor B. The basis matrix given below

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - One-way Basis for factor B 1 2 3 1 1.000 1.000 .000 2 1.000 .000 1.000 3 1.000 -1.000 -1.000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

has effect columns that when transposed match SIMPLE contrasts [1 0 -1] and [0 1 -1]. The contrasts specified by the B basis matrix are:

_ _ _ _ _ CONTRAST B = B - B = ( 2B - B - B ) / 3, and 1 1 1 2 3 _ _ _ _ _ CONTRAST B = B - B = ( - B + 2B - B ) / 3, 2 2 1 2 3

which can also be expressed in a contrast matrix as:

_ _ 1 | 1 1 1 | - | 2 -1 -1 | 3 |_-1 2 -1_|

Once the ONEWAY basis matrices have been specified, the overall basis matrix is constructed from Kronecker products of the column partitions of the ONEWAY matrices:

BASIS AB = [ A x B | A x B | A x B | A x B ] 1 1 2 1 1 2 2 2 where A and B represent the ith column partitions of the A and B basis i i matrices. The result is the overall basis matrix printed by MANOVA: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Between-Subjects Design Matrix (Reduced Model) 1-A 2-B Factor PARAMETER 1 2 1 2 3 4 5 6 1 1 1.00000 1.00000 1.00000 .00000 1.00000 .00000 1 2 1.00000 1.00000 .00000 1.00000 .00000 1.00000 1 3 1.00000 1.00000 -1.00000 -1.00000 -1.00000 -1.00000 2 1 1.00000 -1.00000 1.00000 .00000 -1.00000 .00000 2 2 1.00000 -1.00000 .00000 1.00000 .00000 -1.00000 2 3 1.00000 -1.00000 -1.00000 -1.00000 1.00000 1.00000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The resulting overall contrast matrix could be derived from the formula given earlier, or constructed from Kronecker products of the row partitions of the A and B contrast matrices (in a manner similar to that shown for the overall basis construction). The resulting overall contrast matrix is:

_ _ | 1 1 1 1 1 1 | 1 | 1 1 1 -1 -1 -1 | - | 2 -1 -1 2 -1 -1 | 6 | -1 2 -1 -1 2 -1 | | 2 -1 -1 -2 1 1 | |_-1 2 -1 1 -2 1_|

Factoring out the divisor of 6 which applies to all terms allows us to see the nature of the contrasts more easily. The CONSTANT term is simply the unweighted grand mean:

The A contrast measures the deviation of level 1 of A from the grand mean:__ __ __ __ __ __ _ _ CONSTANT = ( AB + AB + AB + AB + AB + AB ) / 6 = ( A + A ) / 2 = 11 12 13 21 22 23 1 2 _ _ _ ( B + B + B ) / 3 = 6 1 2 3__ __ __ __ __ __ A = ( AB + AB + AB - AB - AB - AB ) / 6 = 1 11 12 13 21 22 23 _ _ _ __ ( A - A ) / 2 = A - AB = -1 1 2 1The B contrasts measure the deviations of levels 1 and 2 of B from the grand mean:__ __ __ __ __ __ B = ( 2AB - AB - AB + 2AB - AB - AB ) / 6 = 1 11 12 13 21 22 23 _ _ _ _ __ ( 2B - B - B ) / 3 = ( B - AB ) = 1 1 2 3 1 __ __ __ __ __ __ B = (- AB + 2AB - AB - AB + 2AB - AB ) / 6 = 2 11 12 13 21 22 23 _ _ _ _ __ (- B + 2B - B ) / 3 = B - AB = -.5 1 2 3 2

The interaction contrasts are specified by the main effect contrasts. The first contrast tests whether the deviation of level 1 of factor A is the same at level 1 of factor B as at levels 2 and 3 of factor B, which is equivalent to testing whether the deviation of level 1 of factor B is the same at both levels of factor A. The last contrast tests whether the deviation of level 1 of factor A is the same at level 2 of B as at levels 1 and 3, which is equivalent to testing whether the deviation of level 2 of factor B is the same at both levels of factor A. In comparing these formulas with the output given below, note that the parameter numbering in MANOVA is hard coded and cannot be changed by the user.

__ __ __ __ __ __ AB = ( 2AB - AB - AB - 2AB + AB + AB ) / 6 = 1 11 12 13 21 22 23 __ _ __ _ __ _ [ 2 ( AB - B ) - ( AB - B ) - ( AB - B ) ] / 3 = 11 1 12 2 13 3 __ _ __ _ [ ( AB - A ) - ( AB - A ) ] / 2 = 0 , 11 1 21 2 __ __ __ __ __ __ AB = (- AB + 2AB - AB + AB - 2AB + AB ) / 6 = 2 11 12 13 21 22 23 __ _ __ _ __ _ [ 2 ( AB - B ) - ( AB - B ) - ( AB - B ) ] / 3 = 12 2 11 1 13 3 __ _ __ _ [ ( AB - A ) - ( AB - A ) ] / 2 = .5 . 12 1 22 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Estimates for Y1 --- Individual univariate .9500 confidence intervals CONSTANT Parameter Coeff. Std. Err. t-Value Sig. t Lower -95% CL- Upper 1 6.00000000 .49786 12.05161 .00000 4.92444 7.07556 A Parameter Coeff. Std. Err. t-Value Sig. t Lower -95% CL- Upper 2 -1.0000000 .49786 -2.00860 .06582 -2.07556 .07556 B Parameter Coeff. Std. Err. t-Value Sig. t Lower -95% CL- Upper 3 1.00000000 .72575 1.37789 .19149 -.56788 2.56788 4 -.50000000 .70408 -.71015 .49016 -2.02107 1.02107 A BY B Parameter Coeff. Std. Err. t-Value Sig. t Lower -95% CL- Upper 5 .000000000 .72575 .00000 1.00000 -1.56788 1.56788 6 .500000000 .70408 .71015 .49016 -1.02107 2.02107 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Now that you have seen how MANOVA handles default contrasts, you might want to apply the formulas listed earlier that relate the contrast and basis matrices to other types of contrasts you use in your own analyses. This is only one of a number of topics on which the SPSS MATRIX procedure can be an invaluable aid in understanding the functioning of MANOVA and other SPSS procedures.

Appendix: Data A B Y1 1 1 8 1 1 5 1 1 7 1 1 4 1 2 7 1 2 2 1 2 6 1 3 4 1 3 1 1 3 7 2 1 7 2 1 9 2 2 4 2 2 6 2 2 8 2 3 7 2 3 9 2 3 6 2 3 6

**TESTING SIMPLE EFFECTS IN MANOVA
David P. Nichols
Senior Support Statistician
SPSS, Inc.
From SPSS Keywords, May 1993**

Factorial designs in analysis of variance and covariance, including designs with within subjects factors, are very common in many fields of research. The SPSS MANOVA procedure provides a powerful and flexible set of tools for performing most of the analyses that are available under the general linear model framework. A very common problem is that of an experiment in which interactions have been found and the researcher wants to explore the data more carefully to determine what statements may be made about main effects or interactions in the presence of the two-way or higher order interaction effects. Tests of such simple main effects or simple interaction effects are generally easily handled in MANOVA through the flexibility in model specification offered by the DESIGN and WSDESIGN subcommands.

Two-way Between Subjects Models: Estimating Simple Main Effects

Let’s begin with the simplest case in which we might want to test for simple effects: a two-way factorial design in which we have found an interaction effect. If the two factors are both between subjects factors and have two and three levels respectively, we might have the following syntax for the factorial analysis:

MANOVA Y BY A(1,2) B(1,3).

This one line of syntax will produce the full factorial analysis (MANOVA always does a full factorial model by default), equivalent to specifying either

MANOVA Y BY A(1,2) B(1,3) /DESIGN or MANOVA Y BY A(1,2) B(1,3) /DESIGN=A, B, A BY B.

If the A by B interaction term is nonzero, the effects of the two factors A and B are not the same across all levels of the other factor. That is, it is possible for A to have a positive effect on the dependent variable at one level of B, no effect at another level and a negative effect at a third level. Such a situation might lead to an overall main effects test for A in which no evidence of any A effect was discovered. This is because the effect of A is confounded with the A by B interaction effect. It is also possible that A has a positive (or negative) effect at each level of B, but that this effect is stronger at some levels of B than at others. In this case it does make sense to talk about an overall positive (or negative) main effect for factor A, but discussion of the magnitude of this effect must be conditioned on the particular levels of the B factor within which these effects do not differ.

In each of these cases what is called for is to examine the effects of the A factor separately within each level of the B factor. These effects are what are known as simple main effects. Specification of such effects in MANOVA is simple, following a logical algorithm applied to our model specifications on the DESIGN subcommand. The general algorithm is as follows: To obtain the proper simple effects estimates and tests of one factor at (within) each level of a second factor, replace the main effect of the factor of interest and the two-way interaction involving these two factors with the simple effects of the factor of interest within each level of the other factor. For our example, we would replace the main effect of factor A and the A by B interaction with the simple effects of factor A at each level of factor B:

MANOVA Y BY A(1,2) B(1,3) /DESIGN=B, A W B(1), A W B(2), A W B(3)

where the W operator is an acceptable shorthand for the WITHIN keyword.

Important notes to keep in mind here are the following: We have simply removed the main effect of the A factor and the A by B interaction term from a full factorial specification and have replaced them with a request for the simple effects of A within (separately for) each level of factor B. The effect of this substitution is to repartition the same overall model into different effects, but to maintain the same total model (total degrees of freedom, total sums of squares accounted for, same predicted values and residuals, etc). That is, we are estimating the same B main effect as in the original full factorial model, and repartitioning the A main effect and the A by B interaction effect into the simple main effects of A at each level of B.

This is important to note for two reasons. First, when working with data with unequal numbers of observations in the cells of the design (generally referred to as unbalanced data), the sums of squares for a particular effect such as A W B(1) will generally not be the same when specified alone on the DESIGN subcommand as when specified as part of a larger model, due to the intercorrelation among the factors in an unbalanced design. The algorithm outlined here is designed to maintain the same overall model throughout the testing of simple effects so that the simple effects estimated are logical followups to the results of the overall full factorial analysis. Second, in releases beginning with version 5.0 the default error term in MANOVA has been changed from WITHIN CELLS to WITHIN+RESIDUAL. Thus even in balanced designs, the error term and degrees of freedom used for testing simple effects would not be the same as in the original analysis unless the same overall model was estimated or unless the user explicitly specified /ERROR=WITHIN on the ERROR subcommand.

So far we have talked only in terms of the simple main effects of A at each level of B. However, the implications of an interaction effect are completely symmetric. That is, to say that the effects of factor A are different at different levels of factor B is equivalent to saying that the effects of factor B are different at different levels of factor A. Thus we would probably also want to test the simple main effects of B at each level of A. To do this we would simply follow the same algorithm, reversing the role of factor A and factor B. That is, we remove the main effect of factor B from the full factorial specification, along with the A by B interaction and substitute the simple main effects of B at each level of A. Our syntax would thus be:

MANOVA Y BY A(1,2) B(1,3) /DESIGN=A, B W A(1), B W A(2).

One important point to note is that since the A and B simple main effects each involve a repartitioning of the interaction term, attempting to fit both sets of simple main effects on one DESIGN subcommand would introduce redundant effects and should thus be avoided. Estimation of both sets of simple main effects in one MANOVA run can be accomplished simply by stacking two DESIGN subcommands:

MANOVA Y BY A(1,2) B(1,3) /DESIGN=B, A W B(1), A W B(2), A W B(3) /DESIGN=A, B W A(1), B W A(2).

**General Between Subjects Models: Estimating Simple Main Effects**

The algorithm outlined above generalizes immediately to cases of higher order designs. Let’s illustrate with the case of a three-way design, with factors A, B and C. For the sake of brevity we will assume that each factor has only two levels, since there is no loss of generality in our discussion and this saves us from writing out more terms in our DESIGN specifications.

If in a higher order design we wish to estimate simple main effects, the procedure is exactly that outlined above, except that we would have other terms also listed on the DESIGN subcommand. For example, in an A by B by C design in which we wanted to estimate the simple effects of A at each level of B, we would perform the same replacement of main and interaction effect terms as before, but would maintain the model specifications involving the C factor. Thus our full factorial syntax

MANOVA Y BY A B C(1,2) /DESIGN=A, B, C, A BY B, A BY C, B BY C, A BY B BY C

would become

MANOVA Y BY A B C(1,2) /DESIGN=B, C, A BY C, B BY C, A BY B BY C, A W B(1), A W B(2).

Since we are using UNIQUE or regression approach sums of squares, the order of effects specified makes no difference, assuming that each cell of the design contains at least one observation (designs involving empty cells are much more complicated and require careful special handling).

Many statisticians might object to the foregoing simple effects tests because they are being conducted in a model in which a higher order interaction is being estimated which contains the effects in question. The logic behind this objection would be that first we should test the three-way interaction. If this is significant we should then proceed to test simple, simple main effects and/or simple interaction effects. If it is not significant, remove the three-way interaction and re-estimate the model. That is, follow-up tests on simple effects should not be performed until a final model has been chosen. The algorithm outlined here is not affected by this approach. We would have first re-estimated the model without a three-way interaction term, as

MANOVA Y BY A B C(1,2) /DESIGN=A, B, C, A BY B, A BY C, B BY C

and the same substitutions would apply, resulting in

MANOVA Y BY A B C(1,2) /DESIGN=B, C, A BY C, B BY C, A W B(1), A W B(2).

Others would consider this approach somewhat rigid. That is, though an interaction effect in a sample was not of sufficient magnitude to provide evidence at (say) the .05 alpha level of an interaction effect in the population, the assumption of no interaction effect as opposed to a small one might be presumptuous. Thus another strategy would be to fit the simple effects in the context of the overall factorial model, estimating them in the presence of the estimated questionable interaction effects. Each user is responsible for coming to her or his own conclusions as to what procedures should be followed in this case; MANOVA can be made to analyze the data in either case.

General Between Subjects Models: Estimating Simple, Simple Main Effects and Simple Interaction Effects

If the three-way interaction had been significant in the above model, we would be faced with a more complicated situation. That is, not only do the effects of factor A depend on which level of factor B we consider, but they also depend on the level of factor C in which our A by B designation of interest is found. The logical step at this point is to examine the two-way interactions at each level of the third factor (such as A by B within each level of C) to see if within each level of the third factor the main effects of the other two factors are invariant. Generalization of the algorithm discussed in the two-way case results in the A by B and A by B by C interactions being replaced by the simple interaction effects of A by B at each level of C. Thus

MANOVA Y BY A B C(1,2) /DESIGN=A, B, C, A BY B, A BY C, B BY C, A BY B BY C

becomes

MANOVA Y BY A B C(1,2) /DESIGN=A, B, C, A BY C, B BY C, A BY B W C(1), A BY B W C(2).

If the simple interaction effects are nonzero, the next step is to estimate the simple, simple main effects of say, factor A at each level of the two-way breakdown of factors B and C. The simple, simple effects of A at each level of factors B and C involve a repartitioning of the A main effect, the A by B, A by C and A by B by C interactions:

MANOVA Y BY A B C(1,2) /DESIGN=A, B, C, A BY B, A BY C, B BY C, A BY B BY C

becomes

MANOVA Y BY A B C(1,2) /DESIGN=B, C, B BY C, A W B(1) BY C(1), A W B(1) BY C(2), A W B(2) BY C(1), A W B(2) BY C(2).

An equivalent specification would be

MANOVA Y BY A B C(1,2) /DESIGN=B, C, B BY C, A W B(1) W C(1), A W B(1) W C(2), A W B(2) W C(1), A W B(2) W C(2).

As with the more simple two-way case, the factors here are perfectly symmetric, so we could just as sensibly be using B or C in place of A. Also, the substitution rules used here generalize to designs with any number of factors.

Models Involving Within Subjects Effects

As most users are aware, MANOVA offers the capability of using the multivariate approach to analyzing data involving within subjects (often involving repeated measures) effects. The within subjects part of the model is specified separately from the between subjects part, but in an analogous manner, via the WSDESIGN subcommand. Thus a two-way completely within subjects design involving two two-level factors A and B could be specified as:

MANOVA V1 TO V4 /WSFACTORS=A(2) B(2)

which would be the same as

MANOVA V1 TO V4 /WSFACTORS=A(2) B(2) /WSDESIGN

or

MANOVA V1 TO V4 /WSFACTORS=A(2) B(2) /WSDESIGN=A, B, A BY B.

The estimation of simple effects in completely within subjects designs requires no new concepts; we simply apply the same rules to the WSDESIGN subcommand that we applied to the DESIGN subcommand. So the simple effects of A at each level of B would be specified as

MANOVA V1 TO V4 /WSFACTORS=A(2) B(2) /WSDESIGN=B, A W B(1), A W B(2).

This is also true for the more complicated three-way and higher order cases.

**Models Involving Between and Within Subjects Effects**

Since the between and within subjects parts of the model are specified separately in MANOVA, the case of a design involving both between and within subjects factors presents some complications. The specifications for each part of the model are crossed by default. That is, all between subjects factors are automatically crossed with all within subjects factors. Since MANOVA will not allow the specification of between subjects factors on the WSDESIGN subcommand or within subjects factors on the DESIGN subcommand, we need a way to tell the procedure that we want to fit the effects of a factor of one type at each level of one or more factors of the other type. Fortunately, there is a method for doing this, and the algorithm involved is generally no more complex than the earlier one, and in many cases it is even simpler.

Take the case of a two-way model involving one between subjects factor (call it A) and a within subjects factor (TIME). The standard syntax for the full factorial model is

MANOVA V1 V2 BY A(1,2) /WSFACTORS=TIME(2)

which is equivalent to specifying either TIME on the WSDESIGN or A on the DESIGN subcommand, or both. If we want to estimate the simple effects of time for each level of A, we use the MWITHIN keyword on the DESIGN subcommand, and replace the main effect of A with MWITHIN A(1) and MWITHIN A(2):

MANOVA V1 V2 BY A(1,2) /WSFACTORS=TIME(2) /DESIGN=MWITHIN A(1), MWITHIN A(2).

MWITHIN stands for mean within, and it effectively turns the crossing of A and TIME into the nesting of time within each level of A. This case requires some special caution in reading the output, since what we are thinking of as a simple main effect, TIME at each level of A, is listed on the output as an interaction effect. This analysis produces two tables, the first of which contains the between subjects part of the analysis:

* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * Tests of Between-Subjects Effects. Tests of Significance for T1 using UNIQUE sums of squares Source of Variation SS DF MS F Sig of F WITHIN+RESIDUAL 60.64 17 3.57 MWITHIN A(1) 441.80 1 441.80 123.85 .000 MWITHIN A(2) 440.06 1 440.06 123.36 .000 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

What is actually being tested by the MWITHIN A(1) and MWITHIN A(2) terms here are the null hypotheses that the average value across all time points (represented to within a constant multiple by transformed variable T1) is zero within level 1 and level 2 of A, respectively. These are in general not hypotheses in which we are usually interested. The hypotheses of common interest are to be found in the within subjects section of the output:

* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * Tests involving 'TIME' Within-Subject Effect. Tests of Significance for T2 using UNIQUE sums of squares Source of Variation SS DF MS F Sig of F WITHIN+RESIDUAL 78.64 17 4.63 MWITHIN A(1) BY TIME 9.80 1 9.80 2.12 .164 MWITHIN A(2) BY TIME 20.06 1 20.06 4.34 .053 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Transformed variable T2 represents a normalized difference variable comparing the two TIME points. Thus a test of MWITHIN A(1) BY TIME represents a test of the null hypothesis that the TIME differences are zero at level 1 of factor A, and MWITHIN A(2) BY TIME corresponds to a similar test at level 2 of factor A.

The substitution rule in this case is even simpler than in cases in which all factors are either between or within subjects in nature. That is, all we had to do was to remove the A effect from the DESIGN subcommand and replace it with MWITHIN each level of A. The same rule applies when we want to go the other way, to look at A differences at each TIME point:

MANOVA V1 V2 BY A(1,2) /WSFACTORS=TIME(2) /WSDESIGN=MWITHIN TIME(1), MWITHIN TIME(2)

produces tests of corresponding null hypotheses with the roles of the two factors reversed. However, in this case the tables are presented somewhat differently, as all four hypothesis degrees of freedom in the analysis are defined as within subjects effects. In each case we have a constant or intercept term, followed by the term of interest, labeled essentially as an interaction term.

* * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * Tests involving 'MWITHIN TIME(1)' Within-Subject Effect. Tests of Significance for T1 using UNIQUE sums of squares Source of Variation SS DF MS F Sig of F WITHIN+RESIDUAL 65.29 17 3.84 MWITHIN TIME(1) 408.71 1 408.71 106.42 .000 A BY MWITHIN TIME(1) 10.82 1 10.82 2.82 .112 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - * * * * * * A n a l y s i s o f V a r i a n c e -- design 1 * * * * * * Tests involving 'MWITHIN TIME(2)' Within-Subject Effect. Tests of Significance for T2 using UNIQUE sums of squares Source of Variation SS DF MS F Sig of F WITHIN+RESIDUAL 74.00 17 4.35 MWITHIN TIME(2) 473.68 1 473.68 108.82 .000 A BY MWITHIN TIME(2) 18.95 1 18.95 4.35 .052 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

In this case T1 is simply V1 and T2 is simply V2. That is, the transformation applied to the dependent variables was an identity transformation. Thus the MWITHIN TIME(1) effect tests the null hypothesis that the mean of V1 is zero, averaged across both levels of A, and MWITHIN TIME(2) tests a similar hypothesis concerning V2. As before, these tests of constant or intercept terms are not generally of interest. The terms labeled as interactions, A BY MWITHIN TIME(1) and A BY MWITHIN TIME(2) are the effects we want, as they test the null hypotheses that there are no population differences between the levels of factor A for V1 and V2, respectively. The general substitution rule for designs with both between and within subjects factors is to substitute MWITHIN each level of a particular main or interaction effect for that factor or interaction and all effects encompassed by that term. So if we wanted to estimate the effects of TIME at each level of the breakdown of an A by B between subjects design, (the simple, simple main effects of TIME within A by B) we would specify:

MANOVA V1 V2 BY A B(1,2) /WSFACTORS=TIME(2) /DESIGN=MWITHIN A(1) BY B(1), MWITHIN A(1) BY B(2), MWITHIN A(2) BY B(1), MWITHIN A(2) BY B(2).

Thus MWITHIN A BY B specifications replace the A by B interaction and the A and B main effects, which are encompassed within A by B. If we wanted to estimate TIME effects only within the levels of A, we would specify:

MANOVA V1 V2 BY A B(1,2) /WSFACTORS=TIME(2) /DESIGN=B, A BY B, MWITHIN A(1), MWITHIN A(2).

The same logic applies completely when testing simple effects of between subjects factors at different levels of within subjects factors. The substitution algorithm here can also, as in the case involving only between or within subjects factors, be extended to as many factors as necessary.

As mentioned earlier, while it is possible in some designs to estimate more than one set of simple effects at a time, it is safest to do them individually, as the results of specifying redundant requests are often meaningless ANOVA tables. This is particularly true with regard to use of the MWITHIN keyword in releases prior to verion 5.0 of SPSS. In later releases only one term can be used with MWITHIN, but in earlier releases use of redundant MWITHIN requests may produce output of questionable validity that some users will not be able to properly interpret.

Finally, there is some disagreement in the ANOVA literature about the use of error terms in designs involving both between and within subjects factors. Specifically, it is sometimes claimed to be desirable to use a pooled error term when fitting A within each TIME point, just as a pooled error term is used when fitting TIME effects within each A level. However, the simple effects of A at each level of TIME are simply the A effects for the original correlated dependent variables. They are therefore not independent and cannot be pooled to obtain a test statistic with a proper F-distribution under the null hypothesis. Therefore, in this situation MANOVA uses a separate error term at each level of TIME, equivalent to a simple univariate analysis of variance on each dependent variable.

**NONORTHOGONAL CONTRASTS ON WSFACTORS IN MANOVA
David P. Nichols
Senior Support Statistician
SPSS, Inc.
From SPSS Keywords, December 1993**

A substantial number of users have asked how to get SPSS MANOVA to produce nonorthogonal contrasts in repeated measures, or within subjects, designs. The reason that nonorthogonal contrasts (such as the default DEVIATION, or the popular SIMPLE, or some SPECIAL user requested contrasts) are not available when using WSFACTORS is that the averaged tests of significance require orthogonal contrasts, and the program has been structured to ensure that this is the case when WSFACTORS is used (users working on version 5 and later of SPSS should note that DEVIATION is no longer the default contrast type for WSFACTORS). MANOVA thus transforms the original dependent variables Y(1) to Y(K) into transformed variables labeled T1 to TK (if no renaming is done) which represent orthonormal linear combinations of the original variables. The transformation matrix applied by MANOVA can be obtained by specifying PRINT=TRANSFORM. Note that the transformation matrix has been transposed for printing, so that the contrasts estimated by MANOVA are discerned by reading down the columns.

Here is an example, obtained by specifying a simple repeated measures MANOVA with four levels and no between subjects factors. The following syntax produces the output in Figure 1.

MANOVA Y1 TO Y4 /WSFACTORS=TIME(4) /PRINT=TRANSFORM - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Orthonormalized Transformation Matrix (Transposed) T1 T2 T3 T4 Y1 .500 .707 -.408 -.289 Y2 .500 .000 .816 -.289 Y3 .500 .000 .000 .866 Y4 .500 -.707 -.408 -.289 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

To see what contrasts have been obtained, simply read down the columns of the transformation matrix. Thus we have

T1 = .500*Y1 + .500*Y2 + .500*Y3 + .500*Y4 T2 = .707*Y1 - .707*Y4 T3 = -.408*Y1 + .816*Y2 - .408*Y4 T4 = -.289*Y1 - .289*Y2 + .866*Y3 - .289*Y4

Three further points should be noted here. First, the coefficients of the linear combinations used to form the transformed variables are scaled such that the transformation vectors are of unit length (are normalized). This can be duplicated by first specifying the form of the contrasts using integers, then dividing each coefficient by the square root of the sum of the squared integer coefficients. For example,

T3 = ( -1*Y1 + 2*Y2 - 1*Y4 ) / SQRT[ (-1)**2 + 2**2 + (-1)**2 ]

Second, the first transformed variable (T1) is the constant term in the within subjects model, a constant multiple of the mean of the original dependent variables. This will be used to test between subjects effects if any are included in the model. Finally, note that the contrasts generated here are not those that we asked for (since we did not specify any contrasts, the default DEVIATION contrasts would be expected). An orthogonalization of a set of nonorthogonal contrasts changes the nature of the comparisons being made. It is thus very important when interpreting the univariate F-tests or the parameter estimates and their t-statistics to look at the transformation matrix when transformed variables are being used, so that the inferences being drawn are based on the contrasts actually estimated. This is not the case with the multivariate tests. These are invariant to transformation, which means that any set of linearly independent contrasts will produce the same results. The averaged F-tests will be the same given any orthonormal set of contrasts.

Now that we know why we can’t get the contrasts we want when running a design with WSFACTORS, let’s see how to make MANOVA give us what we want. This is actually fairly simple. All that we have to do is to get MANOVA to apply a nonorthogonal transformation matrix to our dependent variables. This can be achieved through the use of the TRANSFORM subcommand. What we do is to remove the WSFACTORS subcommand (and anything else such as WSDESIGN or ANALYSIS(REPEATED) that refers to within subjects designs) and transform the dependent variables ourselves. For our example, the following syntax produces the transformation matrix given in Figure 2.

MANOVA Y1 TO Y4 /TRANSFORM=DEVIATION /PRINT=TRANSFORM /ANALYSIS=(T1/T2 T3 T4) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Transformation Matrix (Transposed) T1 T2 T3 T4 Y1 1.000 .750 -.250 -.250 Y2 1.000 -.250 .750 -.250 Y3 1.000 -.250 -.250 .750 Y4 1.000 -.250 -.250 -.250 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Note that this transformation matrix has not been orthonormalized; it gives us the deviation contrasts we requested. You might be wondering what the purpose of the ANALYSIS subcommand is here. The analysis subcommand is used to separate the transformed variables into effects so that the multivariate tests produced in this case are equivalent to those in the run where WSFACTORS was used. This serves two purposes. First, it allows us to check to make sure that we’re still fitting the same model. Second, it helps us to identify the different effects on the output. In this case, we will have only effects labeled "CONSTANT," since we don’t have any WSFACTORS as far as MANOVA is concerned. MANOVA is simply doing a multivariate analysis on transformed variables. This is the same thing as the WSFACTORS analysis, except that the labeling will not match for the listed effects. In this case, we will look for the effects labeled CONSTANT with T2, T3 and T4 as the variables used in the analysis. These correspond to the TIME effect from the WSFACTORS run, as can be seen by comparing the multivariate tests, but the univariate tests now represent the contrasts that we wanted to see (as would the parameter estimates if we had printed them).

Often the design is more complex than a simple repeated measures analysis. Can this method be extended to any WSFACTORS design? The answer is yes. If there are multiple dependent variables to be transformed (as in a doubly multivariate repeated measures design), each set can be transformed in the same manner. For example, if variables A and B are each measured at 3 time points, resulting in A1, A2, A3, etc., the following MANOVA statements could be used:

MANOVA A1 A2 A3 B1 B2 B3 /TRANSFORM(A1 A2 A3/B1 B2 B3)=SIMPLE /PRINT=TRANSFORM /ANALYSIS=(T1 T4/T2 T3 T5 T6)

The TRANSFORM subcommand tells MANOVA to apply the same transformation matrix to each set of variables. The transformation matrix printed by MANOVA would then have a block diagonal structure, with two 3 x 3 matrices on the main diagonal, and two 3 x 3 null matrices off the main diagonal. The ANALYSIS subcommand separates the two constants, T1 and T4, from the TIME variables, T2 and T3 (for A), and T5 and T6 (for B).

Another complication that may arise is the inclusion of between subjects factors in an analysis. The only real complication involved here is in the interpretation of the output. Printing the transformation matrix always allows us to see what the transformed variables represent, but there is also a way to identify specific effects without reference to the transformation matrix. There are two keys to understanding the output from a MANOVA with a TRANSFORM subcommand:

1) The output will be divided into two sections: those which report statistics and tests for transformed variables T1, etc., which are the constants in the repeated measures model, used for testing between subjects effects, and those which report statistics and tests for the other transformed variables (T2, T3, etc.), which are the contrasts among the dependent variables and measure the time or repeated measures effects.

2) Output indicating that transformed variable T1 has been used represents exactly the effect stated in the output. Output indicating that transformed variables T2, etc. have been used represents the interaction of whatever is listed on the output with the repeated measures factor (such as time). In other words, an effect for CONSTANT using variates T2 and T3 is really the time effect, and an effect FACTOR1 using T2 and T3 is really the FACTOR1 BY TIME interaction effect.

If between subjects effects have been specified, the CONSTANT term must be specified on the DESIGN subcommand in order to get the TIME effects. Also, the effects can always be identified by matching the multivariate results to those from the WSFACTORS approach as long as the effects have been properly separated with an ANALYSIS subcommand.

An example might help to make these principles more concrete. The following MANOVA commands produced the four sets of F-tests listed in Figure 3.

MANOVA Y1 TO Y4 BY A(1,2) /WSFACTORS=TIME(4) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1--The A main effect Tests of Between-Subjects Effects. Tests of Significance for T1 using UNIQUE sums of squares Source of Variation SS DF MS F Sig of F WITHIN CELLS 36.45 17 2.14 A 3.79 1 3.79 1.77 .201 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #2--The A BY TIME interaction effect EFFECT .. A BY TIME Multivariate Tests of Significance (S = 1, M = 1/2, N = 6 1/2) Test Name Value Exact F Hypoth. DF Error DF Sig. of F Pillais .59919 7.47478 3.00 15.00 .003 Hotellings 1.49496 7.47478 3.00 15.00 .003 Wilks .40081 7.47478 3.00 15.00 .003 Roys .59919 Note.. F statistics are exact. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #3--The TIME effect EFFECT .. TIME Multivariate Tests of Significance (S = 1, M = 1/2, N = 6 1/2) Test Name Value Exact F Hypoth. DF Error DF Sig. of F Pillais .29487 2.09085 3.00 15.00 .144 Hotellings .41817 2.09085 3.00 15.00 .144 Wilks .70513 2.09085 3.00 15.00 .144 Roys .29487 Note.. F statistics are exact. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #4--The averaged F-tests for TIME and A BY TIME Tests involving 'TIME' Within-Subject Effect. AVERAGED Tests of Significance for Y using UNIQUE sums of squares Source of Variation SS DF MS F Sig of F WITHIN CELLS 231.32 51 4.54 TIME 25.97 3 8.66 1.91 .140 A BY TIME 30.55 3 10.18 2.25 .094 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The second run used TRANSFORM to analyze the same data, producing the output in Figure 4.

MANOVA Y1 TO Y4 BY A(1,2) /TRANSFORM=SIMPLE /ANALYSIS=(T1/T2 T3 T4) /DESIGN=CONSTANT, A - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Order of Variables for Analysis Variates Covariates T1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #1--The A main effect Tests of Significance for T1 using UNIQUE sums of squares Source of Variation SS DF MS F Sig of F WITHIN CELLS 145.79 17 8.58 CONSTANT 8360.21 1 8360.21 974.86 .000 A 15.16 1 15.16 1.77 .201 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Order of Variables for Analysis Variates Covariates T2 T3 T4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #2--The A BY TIME interaction effect EFFECT .. A Multivariate Tests of Significance (S = 1, M = 1/2, N = 6 1/2) Test Name Value Exact F Hypoth. DF Error DF Sig. of F Pillais .59919 7.47478 3.00 15.00 .003 Hotellings 1.49496 7.47478 3.00 15.00 .003 Wilks .40081 7.47478 3.00 15.00 .003 Roys .59919 Note.. F statistics are exact. EFFECT .. A (Cont.) Univariate F-tests with (1,17) D. F. Variable Hypoth. SS Error SS Hypoth. MS Error MS F Sig. of F T2 18.73743 135.78889 18.73743 7.98758 2.34582 .144 T3 9.58129 227.15556 9.58129 13.36209 .71705 .409 T4 2.24795 108.48889 2.24795 6.38170 .35225 .561 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #3--The TIME effect EFFECT .. CONSTANT Multivariate Tests of Significance (S = 1, M = 1/2, N = 6 1/2) Test Name Value Exact F Hypoth. DF Error DF Sig. of F Pillais .29487 2.09085 3.00 15.00 .144 Hotellings .41817 2.09085 3.00 15.00 .144 Wilks .70513 2.09085 3.00 15.00 .144 Roys .29487 Note.. F statistics are exact. EFFECT .. CONSTANT (Cont.) Univariate F-tests with (1,17) D. F. Variable Hypoth. SS Error SS Hypoth. MS Error MS F Sig. of F T2 23.15848 135.78889 23.15848 7.98758 2.89931 .107 T3 4.94971 227.15556 4.94971 13.36209 .37043 .551 T4 45.19532 108.48889 45.19532 6.38170 7.08202 .016 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

The first table in each run is the test for the between subjects factor A. Note that the F-values and associated significances are identical. The sums of squares differ by a constant multiple due to the orthonormalization. The CONSTANT term in the TRANSFORM run is indeed the constant, and is usually not of interest. The second and third tables in the WSFACTORS run contain only multivariate tests for the A BY TIME and A factors, respectively. The univariate tests here are not printed by default. The corresponding tables in the TRANSFORM output are labeled A and CONSTANT, with the header above indicating that variates T2, T3 and T4 are being analyzed. Note that the multivariate tests are exactly the same as those for the WSFACTORS run. This tells us that we have indeed fit the same model in both runs. The application of our rule for interpreting the labeling in the TRANSFORM run tells us that the second table represents A BY TIME and that the third table represents CONSTANT BY TIME, which is simply TIME. Since MANOVA is simply running a multivariate analysis with transformed variables, as opposed to a WSFACTORS analysis, univariate F-tests are printed by default. The univariate tests for TIME are generally the major source of interest, as they are usually the reason for the TRANSFORM run. The A BY TIME tests may be the tests of interest if interaction is present. Finally, the WSFACTORS run presents the averaged F-tests, which are not available in the TRANSFORM run (and which would not be valid, since we have not used orthogonal contrasts).

One further example setup might be helpful in order to clarify how we would proceed if we had multiple within subject factors. This is probably the most complex and potentially time consuming situation we will encounter when trying to get MANOVA to estimate nonorthogonal contrasts in within subjects designs, since we must know the entire contrast (transformation) matrix we want MANOVA to apply to our data.

In this case we must use a SPECIAL transformation, and spell out the entire transformation matrix (or at least the entire matrix for each dependent variable; if there are multiple dependent variables we can tell MANOVA to apply the same transformation to each). Let’s look at a situation where we have a 2 x 3 WSDESIGN and we want to do SIMPLE contrasts on each of our WSFACTORS. The standard syntax for the WSFACTORS run would be:

MANOVA V1 TO V6 /WSFACTORS=A(2) B(3)

The syntax for the TRANSFORM run would be:

MANOVA V1 TO V6 /TRANSFORM=SPECIAL(1 1 1 1 1 1 1 1 1 -1 -1 -1 1 0 -1 1 0 -1 0 1 -1 0 1 -1 1 0 -1 -1 0 1 0 1 -1 0 -1 1) /PRINT=TRANSFORM /ANALYSIS=(T1/T2/T3 T4/T5 T6)

Note that the final two rows of the contrast matrix are simply coefficient by coefficient multiples of rows two and three and two and four, respectively. Also, the ANALYSIS subcommand here separates the effects into four groups: the CONSTANT and A effects (each with one degree of freedom), and the B and A BY B interaction effect (with two degrees of freedom). Once again, this separation allows us to compare the TRANSFORM output with appropriate parts of the WSFACTORS output. Though this use of SPECIAL transformations can be somewhat tedious if there are many WSFACTORS or some of these factors have many levels, it is also very general and will allow us to obtain the desired contrasts for designs of any size.

**This page was adapted from a web page at the SPSS web page.
We thank SPSS for their permission to adapt and distribute this page via our web site.**