.BG
.FN cancor
.TL
Canonical Correlation Analysis
.CS
cancor(x, y, xcenter, ycenter)
.PP
.AG x,y
two matrices of data.  The number of rows (number of
observations) must be the same in each.
.AG xcenter
controls the centering applied to the columns of `x' before computing
the canonical analysis.
If `TRUE' or if the argument is missing, column means are removed.  If `FALSE', no centering is done.
If the argument is numeric, the numeric values are removed from the corresponding
columns.
.AG ycenter
controls the centering applied to the columns of `y', analogously to `xcenter'
for the columns of `x'.
.RT
structure representing the canonical correlation analysis;
i.e., a set of pairs of linear combinations of the variables
in `x' and in `y' such that the first pair has the largest
possible correlation, the second pair has the largest
correlation among variables uncorrelated with the first
pair, etc.
.PP
.RC cor
the correlations between the pairs of variables.
.RC xcoef
the matrix of linear combinations of the columns of `x'.
The first column of `xcoef' is the linear combination of
columns of `x' corresponding to the first canonical
correlation, etc.
.RC ycoef
like xcoef, but originating from y.
.RC xcenter
vector of values subtracted from the columns of `x'.
.RC ycenter
vector of values subtracted from the columns of `y'.
.EX
#canonical decomposition with column means swept out
cancor(x, y)
.sp
#canonical deomposition with column medians of x subtracted out, y as is
cancor(x, y, apply(x,2,median), F)
.KW multivariate
.KW array*
.WR
