Computational Details
General Formulas
Canonical discriminant analysis is equivalent to canonical correlation
analysis between the quantitative variables and a set of dummy variables
coded from the class variable. In the following notation the dummy
variables will be denoted by y and the quantitative variables by x.
The total sample covariance matrix for the x and y variables is
When c is the number of groups, n_{t} is the number of observations in
group t, and S_{t} is the sample covariance matrix for the x variables
in group t, the withinclass pooled covariance matrix for the x
variables is
The canonical correlations, , are the square roots of the
eigenvalues, , of the following matrix. The corresponding
eigenvectors are v_{i}.

S_{p}^{1/2}S_{xy}S_{yy}^{1}S_{yx}S_{p}^{1/2}
Let V be the matrix with the eigenvectors v_{i} that correspond to
nonzero eigenvalues as columns. The raw canonical coefficients are
calculated as follows

R = S_{p}^{1/2}V
The pooled withinclass standardized canonical coefficients are

P = diag(S_{p})^{1/2}R
And the total sample standardized canonical coefficients are

T = diag(S_{xx})^{1/2}R
Let X_{c} be the matrix with the centered x variables as columns. The
canonical scores may be calculated by any of the following

X_{c} R

X_{c} diag(S_{p})^{1/2}P

X_{c} diag(S_{xx})^{1/2}T
For the Multivariate tests based on E^{1}H

E = (n1)(S_{yy}  S_{yx}S_{xx}^{1}S_{xy})

H = (n1)S_{yx}S_{xx}^{1}S_{xy}
where n is the total number of observations.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.