NORTHOGONAL CONTRASTS ON WSFACTORS IN MANOVA

David P. Nichols

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 Figure 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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) Figure 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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) Figure 3 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #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 Figure 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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.