Two Way MANOVA

The SAS commands for a two way analysis of variance with 3 response variables.

data mas;
    infile 'mas';
    input row column y1 y2 y3;
proc print;
proc glm;
     class row column;
     model y1-y3 = row | column;
           manova h=_all_ / printh printe;
run;
The OUTPUT
                    OBS    ROW    COLUMN     Y1      Y2      Y3

                      1     1        1      18.2    16.5    0.2
                      2     1        1      18.7    19.5    0.3
                      3     1        1      19.5    19.8    0.2
                      4     1        2      19.2    19.5    0.2
                      5     1        2      18.4    19.8    0.2
                      6     1        2      20.7    19.4    0.2
                      7     2        1      21.3    23.3    0.3
                      8     2        1      19.6    22.3    0.5
                      9     2        1      20.2    19.0    0.4
                     10     2        2      18.9    22.0    0.3
                     11     2        2      20.7    21.1    0.2
                     12     2        2      21.6    20.3    0.2
                     13     3        1      20.7    16.7    0.3
                     14     3        1      21.0    19.3    0.4
                     15     3        1      17.2    15.9    0.3
                     16     3        2      20.2    19.0    0.2
                     17     3        2      18.4    17.9    0.3
                     18     3        2      20.9    19.9    0.2

                          General Linear Models Procedure

Dependent Variable: Y1

Source          DF   Sum of Squares     Mean Square  F Value    Pr > F

Model            5       5.47777778      1.09555556     0.62    0.6856
Error           12      21.10666667      1.75888889

Corrected Total 17      26.58444444

      R-Square                   C.V.              Root MSE            Y1 Mean
      0.206052               6.716984            1.32623108        19.74444444

Source        DF              Type I SS           Mean Square  F Value    Pr > F

ROW            2             4.81444444            2.40722222     1.37    0.2915
COLUMN         1             0.37555556            0.37555556     0.21    0.6523
ROW*COLUMN     2             0.28777778            0.14388889     0.08    0.9220

Source        DF            Type III SS           Mean Square  F Value    Pr > F

ROW            2             4.81444444            2.40722222     1.37    0.2915
COLUMN         1             0.37555556            0.37555556     0.21    0.6523
ROW*COLUMN     2             0.28777778            0.14388889     0.08    0.9220
                          General Linear Models Procedure

Dependent Variable: Y2

Source           DF    Sum of Squares           Mean Square  F Value    Pr > F

Model             5       38.33111111            7.66622222     3.45    0.0365
Error            12       26.64666667            2.22055556

Corrected Total  17       64.97777778

      R-Square                   C.V.              Root MSE            Y2 Mean
      0.589911               7.637458            1.49015286        19.51111111

Source      DF          Type I SS           Mean Square  F Value    Pr > F

ROW          2        32.68777778           16.34388889     7.36    0.0082
COLUMN       1         2.42000000            2.42000000     1.09    0.3171
ROW*COLUMN   2         3.22333333            1.61166667     0.73    0.5040

Source      DF            Type III SS           Mean Square  F Value    Pr > F

ROW          2        32.68777778           16.34388889     7.36    0.0082
COLUMN       1         2.42000000            2.42000000     1.09    0.3171
ROW*COLUMN   2         3.22333333            1.61166667     0.73    0.5040
                          General Linear Models Procedure

Dependent Variable: Y3

Source          DF     Sum of Squares       Mean Square  F Value    Pr > F

Model            5         0.08944444        0.01788889     4.60    0.0142
Error           12         0.04666667        0.00388889

Corrected Total 17         0.13611111

      R-Square                   C.V.              Root MSE            Y3 Mean
      0.657143               22.90811            0.06236096         0.27222222

Source      DF          Type I SS           Mean Square  F Value    Pr > F

ROW          2         0.03111111            0.01555556     4.00    0.0467
COLUMN       1         0.04500000            0.04500000    11.57    0.0053
ROW*COLUMN   2         0.01333333            0.00666667     1.71    0.2214

Source          DF        Type III SS       Mean Square  F Value    Pr > F

ROW              2         0.03111111        0.01555556     4.00    0.0467
COLUMN           1         0.04500000        0.04500000    11.57    0.0053
ROW*COLUMN       2         0.01333333        0.00666667     1.71    0.2214


                              E = Error SS&CP Matrix

                               Y1                Y2                Y3

             Y1      21.106666667      8.7833333333      -0.336666667
             Y2      8.7833333333      26.646666667      0.1733333333
             Y3      -0.336666667      0.1733333333      0.0466666667

     Partial Correlation Coefficients from the Error SS&CP Matrix / Prob > |r|

                     DF = 12           Y1        Y2        Y3

                     Y1          1.000000  0.370363 -0.339224
                                   0.0001    0.1924    0.2354

                     Y2          0.370363  1.000000  0.155438
                                   0.1924    0.0001    0.5957

                     Y3         -0.339224  0.155438  1.000000
                                   0.2354    0.5957    0.0001

                         H = Type III SS&CP Matrix for ROW

                               Y1                Y2                Y3

             Y1      4.8144444444      8.6894444444      0.3788888889
             Y2      8.6894444444      32.687777778      0.5355555556
             Y3      0.3788888889      0.5355555556      0.0311111111


             Characteristic Roots and Vectors of: E Inverse * H, where
            H = Type III SS&CP Matrix for ROW   E = Error SS&CP Matrix

   Characteristic   Percent            Characteristic Vector  V'EV=1
        Root
                                           Y1             Y2             Y3

     1.4168928493     60.38        0.08675028     0.10844970     3.01899089
     0.9296485423     39.62        0.17077050    -0.19102215     3.79949398
     0.0000000000      0.00        0.17564640    -0.01621960    -1.85991340


Manova Test Criteria and F Approximations for the Hypothesis of 
                      no Overall ROW Effect
            H = Type III SS&CP Matrix for ROW   E = Error SS&CP Matrix

                                 S=2    M=0    N=4

  Statistic                   Value          F     Num DF     Den DF   Pr > F

  Wilks' Lambda            0.21441955     3.8652        6         20   0.0101
  Pillai's Trace           1.06801654     4.2019        6         22   0.0058
  Hotelling-Lawley Trace   2.34654139     3.5198        6         18   0.0175
  Roy's Greatest Root      1.41689285     5.1953        3         11   0.0177

           NOTE: F Statistic for Roy's Greatest Root is an upper bound.
                   NOTE: F Statistic for Wilks' Lambda is exact.

                       H = Type III SS&CP Matrix for COLUMN

                           Y1                Y2                Y3

         Y1      0.3755555556      0.9533333333             -0.13
         Y2      0.9533333333              2.42             -0.33
         Y3             -0.13             -0.33             0.045


             Characteristic Roots and Vectors of: E Inverse * H, where
           H = Type III SS&CP Matrix for COLUMN   E = Error SS&CP Matrix

 Characteristic   Percent                Characteristic Vector  V'EV=1
    Root
                                       Y1             Y2             Y3

 1.3996816546    100.00            0.10400705    -0.11631325     5.02460032
 0.0000000000      0.00            0.18866959     0.06194770     0.99932858
 0.0000000000      0.00           -0.14534839     0.17648679     0.87434110

Manova Test Criteria and Exact F Statistics for the 
                         Hypothesis of no Overall COLUMN Effect
           H = Type III SS&CP Matrix for COLUMN   E = Error SS&CP Matrix

                                S=1    M=0.5    N=4

 Statistic                   Value         F      Num DF    Den DF   Pr > F

 Wilks' Lambda            0.41672194    4.6656       3        10   0.0275
 Pillai's Trace           0.58327806    4.6656       3        10   0.0275
 Hotelling-Lawley Trace   1.39968165    4.6656       3        10   0.0275
 Roy's Greatest Root      1.39968165    4.6656       3        10   0.0275


                     H = Type III SS&CP Matrix for ROW*COLUMN

                            Y1                Y2                Y3

             Y1   0.2877777778             0.435              0.06
             Y2          0.435      3.2233333333      0.1366666667
             Y3           0.06      0.1366666667      0.0133333333


             Characteristic Roots and Vectors of: E Inverse * H, where
         H = Type III SS&CP Matrix for ROW*COLUMN   E = Error SS&CP Matrix

   Characteristic   Percent           Characteristic Vector  V'EV=1
        Root
                                          Y1             Y2             Y3

     0.3839204951     79.53       0.11759006    -0.00082192     4.84330698
     0.0987901789     20.47      -0.13435865     0.21946605    -1.57116127
     0.0000000000      0.00       0.18883899     0.01865076    -1.04094579

                  Manova Test Criteria and F Approximations for
                  the Hypothesis of no Overall ROW*COLUMN Effect
         H = Type III SS&CP Matrix for ROW*COLUMN   E = Error SS&CP Matrix

                                 S=2    M=0    N=4

  Statistic                Value          F      Num DF     Den DF   Pr > F

  Wilks' Lambda          0.65761860     0.7771        6        20   0.5973
  Pillai's Trace         0.36732328     0.8249        6        22   0.5629
  Hotelling-Lawley Trace 0.48271067     0.7241        6        18   0.6359
  Roy's Greatest Root    0.38392050     1.4077        3        11   0.2926

           NOTE: F Statistic for Roy's Greatest Root is an upper bound.
                   NOTE: F Statistic for Wilks' Lambda is exact.

Some Comments on the Output

  1. The output presents 3 univariate 2 way analyses of variance for each of the three response variables before presenting an ANOVA table. It also presents MANOVA tests for the 3 responses thought of as 1 vector. You should check that the diagonal entries in the H matrices are precisely the sums of squares in the univariate ANOVA tables. Thus the 3, 3 entry in the H matrix for ROW*COLUMN is 0.0133333333 and this is also the sum of squares for ROW*COLUMN in the analysis of Y3.
  2. It is standard, as in the univariate case to begin by looking for interactions. If they are present you need to analysis the data as a one way layout with 6 cells and compare combinations of row/column levels with each other. If the interaction effects are absent you then examine the main effects. In this case the MANOVA tests for interactions all have P-values in the range 0.3 to 0.7 so we would proceed as interactions were not present. The univariate analyses also show no great evidence of interaction effects.
  3. There are only 2 levels of the factor COLUMN and so the MANOVA test statistics are all actually Hotelling's tex2html_wrap_inline19 tests; this shows up in the fact that all the tests have the same, significant, P-value. There is evidence of a column effect. The univariate analyses suggest strongly that this effect is actually only present on Y3.
  4. There are 3 levels of ROW and so the tests are not all the same. Notice that the F test P values for Wilk's tex2html_wrap_inline27 are exact. Morrison's text gives a catalogue of cases where this test will lead to exact F inferences. There is clear evidence of a ROW effect. This effect appears to happen on Y2 and Y3 but not Y1.
  5. Multiple comparison procedures might well be used at this point to make precise statements about the source of the significant effects.
  6. The model might conceivably be rerun with the statement model y1 y2 y3 = row column, that is, without an interaction. Then the H matrix for interactions will be pooled with the Error SSCP matrix.



Richard Lockhart
Tue Feb 17 22:47:36 PST 1998