data hw5;
input y1 y2 y3 group;
cards;
19.6 5.15 9.5 1
15.4 5.75 9.1 1
22.3 4.35 3.3 1
...
16.5 6.55 3.3 3
17.4 6.60 1.9 3
;
proc discrim manova canonical;
class group;
var y1 y2 y3;
run;

---------------------------------------------------------------------------------                            

                              Discriminant Analysis
                  33 Observations        32 DF Total
                   3 Variables           30 DF Within Classes
                   3 Classes              2 DF Between Classes


                            Class Level Information
                                                                      Prior
           GROUP     Frequency        Weight     Proportion     Probability
               1            11       11.0000       0.333333        0.333333
               2            11       11.0000       0.333333        0.333333
               3            11       11.0000       0.333333        0.333333

        Discriminant Analysis     Pooled Covariance Matrix Information

                Covariance       Natural Log of the Determinant
                Matrix Rank      of the Covariance Matrix

                      3                    5.90664529

Discriminant Analysis     Pairwise Generalized Squared Distances Between Groups

                       2         _   _       -1  _   _
                      D (i|j) = (X - X )' COV   (X - X )
                                  i   j           i   j

                         Generalized Squared Distance to GROUP

          From GROUP                1                2                3

                   1                0          3.82929          3.47439
                   2          3.82929                0          0.03729
                   3          3.47439          0.03729                0

                             Discriminant Analysis

                 Multivariate Statistics and F Approximations
                              S=2    M=0    N=13

Statistic                     Value          F      Num DF    Den DF  Pr > F
 Wilks' Lambda              0.52578837     3.5382         6        56  0.0049
 Pillai's Trace             0.47667015     3.0248         6        58  0.0122
 Hotelling-Lawley Trace     0.89723004     4.0375         6        54  0.0021
 Roy's Greatest Root        0.89198797     8.6226         3        29  0.0003

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

                        Canonical Discriminant Analysis

                                 Adjusted       Approx       Squared
                  Canonical      Canonical     Standard     Canonical
                 Correlation    Correlation     Error      Correlation
            1      0.686626       0.656071     0.093434      0.471455
            2      0.072213       -.139365     0.175855      0.005215

                                Eigenvalues of INV(E)*H
                                  = CanRsq/(1-CanRsq)

                 Eigenvalue    Difference    Proportion    Cumulative
            1       0.8920        0.8867       0.9942        0.9942
            2       0.0052         .           0.0058        1.0000

                        Canonical Discriminant Analysis

                     Test of H0: The canonical correlations in the
                       current row and all that follow are zero

               Likelihood
                  Ratio      Approx F      Num DF      Den DF    Pr > F
          1    0.52578837      3.5382           6          56    0.0049
          2    0.99478527      0.0760           2          29    0.9270

                        Canonical Discriminant Analysis

                           Total Canonical Structure

                                    CAN1              CAN2
                    Y1          0.565965          0.545702
                    Y2          0.243728          0.693850
                    Y3          0.581791         -0.525512


                          Between Canonical Structure

                                    CAN1              CAN2
                    Y1          0.994898          0.100888
                    Y2          0.957983          0.286823
                    Y3          0.995518         -0.094572

                        Canonical Discriminant Analysis

                       Pooled Within Canonical Structure

                                    CAN1              CAN2
                    Y1          0.446970          0.591245
                    Y2          0.179960          0.702846
                    Y3          0.461776         -0.572231


               Total-Sample Standardized Canonical Coefficients

                                    CAN1              CAN2
                    Y1       1.155991773       0.260161821
                    Y2      -0.020572469       0.761278877
                    Y3       1.173241223      -0.572005336

                        Canonical Discriminant Analysis

            Pooled Within-Class Standardized Canonical Coefficients

                                    CAN1              CAN2
                    Y1       1.099060382       0.247349122
                    Y2      -0.020920448       0.774155771
                    Y3       1.109884712      -0.541116324


                          Raw Canonical Coefficients

                                    CAN1              CAN2
                    Y1      0.3511025889      0.0790174213
                    Y2      -.0101965163      0.3773194483
                    Y3      0.2944046829      -.1435348897

                        Canonical Discriminant Analysis

                      Class Means on Canonical Variables

                      GROUP              CAN1              CAN2
                          1       1.272352374       0.004139492
                          2      -0.682939550       0.082401706
                          3      -0.589412825      -0.086541197

            Discriminant Analysis     Linear Discriminant Function

                        _     -1 _                              -1 _
         Constant = -.5 X' COV   X      Coefficient Vector = COV   X
                         j        j                                 j

                                     GROUP

                                  1                2                3
          CONSTANT        -42.50513        -27.30460        -27.52927
          Y1                3.39524          2.71492          2.73441
          Y2                0.69642          0.74589          0.68119
          Y3                2.20958          1.62270          1.67448


Discriminant Analysis     Classification Summary for Calibration Data: WORK.HW5

           Resubstitution Summary using Linear Discriminant Function

              Generalized Squared Distance Function:

               2         _       -1   _
              D (X) = (X-X )' COV  (X-X )
               j          j            j

              Posterior Probability of Membership in each GROUP:

                                 2                    2
              Pr(j|X) = exp(-.5 D (X)) / SUM exp(-.5 D (X))
                                 j        k           k


Discriminant Analysis     Classification Summary for Calibration Data: WORK.HW5

           Resubstitution Summary using Linear Discriminant Function

                     Number of Observations and Percent Classified into GROUP:

        From GROUP              1              2              3          Total
                 1              9              0              2             11
                            81.82           0.00          18.18         100.00
                 2              2              5              4             11
                            18.18          45.45          36.36         100.00
                 3              2              5              4             11
                            18.18          45.45          36.36         100.00

Discriminant Analysis     Classification Summary for Calibration Data: WORK.HW5

           Resubstitution Summary using Linear Discriminant Function

                     Number of Observations and Percent Classified into GROUP:

        From GROUP              1              2              3          Total
             Total             13             10             10             33
           Percent          39.39          30.30          30.30         100.00

            Priors         0.3333         0.3333         0.3333

Discriminant Analysis     Classification Summary for Calibration Data: WORK.HW5

           Resubstitution Summary using Linear Discriminant Function

               Error Count Estimates for GROUP:

                          1                2                3        Total
    Rate             0.1818           0.5455           0.6364       0.4545
    Priors           0.3333           0.3333           0.3333