\HeaderA{corresp}{Simple Correspondence Analysis}{corresp}
\methaliasA{corresp.data.frame}{corresp}{corresp.data.frame}
\methaliasA{corresp.default}{corresp}{corresp.default}
\methaliasA{corresp.factor}{corresp}{corresp.factor}
\methaliasA{corresp.formula}{corresp}{corresp.formula}
\methaliasA{corresp.matrix}{corresp}{corresp.matrix}
\methaliasA{corresp.xtabs}{corresp}{corresp.xtabs}
\keyword{category}{corresp}
\keyword{multivariate}{corresp}
\begin{Description}\relax
Find the principal canonical correlation and corresponding row- and
column-scores from a correspondence analysis of a two-way contingency
table.
\end{Description}
\begin{Usage}
\begin{verbatim}
corresp(x, ...)

## S3 method for class 'matrix':
corresp(x, nf = 1, ...)

## S3 method for class 'factor':
corresp(x, y, ...)

## S3 method for class 'data.frame':
corresp(x, ...)

## S3 method for class 'xtabs':
corresp(x, ...)

## S3 method for class 'formula':
corresp(formula, data, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x, formula}] The function is generic, accepting various forms of the principal
argument for specifying a two-way frequency table.  Currently accepted
forms are matrices, data frames (coerced to frequency tables), objects
of class \code{"\LinkA{xtabs}{xtabs}"} and formulae of the form \code{\textasciitilde{} F1 + F2},
where \code{F1} and \code{F2} are factors.

\item[\code{nf}] The number of factors to be computed. Note that although 1 is the most
usual, one school of thought takes the first two singular vectors for
a sort of biplot.

\item[\code{y}] a second factor for a cross-classification.
\item[\code{data}] a data frame against which to preferentially resolve
variables in the formula.
\item[\code{...}] If the principal argument is a formula, a data frame may be specified
as well from which variables in the formula are preferentially
satisfied.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
See Venables \& Ripley (2002).  The \code{plot} method produces a graphical
representation of the table if \code{nf=1}, with the \emph{areas} of circles
representing the numbers of points.  If \code{nf} is two or more the
\code{biplot} method is called, which plots the second and third columns of
the matrices \code{A = Dr\textasciicircum{}(-1/2) U L} and \code{B = Dc\textasciicircum{}(-1/2) V L} where the
singular value decomposition is \code{U L V}.  Thus the x-axis is the
canonical correlation times the row and column scores.  Although this
is called a biplot, it does \emph{not} have any useful inner product
relationship between the row and column scores.  Think of this as an
equally-scaled plot with two unrelated sets of labels.  The origin is
marked on the plot with a cross.  (For other versions of this plot see
the book.)
\end{Details}
\begin{Value}
An list object of class \code{"correspondence"} for which
\code{print}, \code{plot} and \code{biplot} methods are supplied.
The main components are the canonical correlation(s) and the row
and column scores.
\end{Value}
\begin{References}\relax
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.

Gower, J. C. and Hand, D. J. (1996)
\emph{Biplots.}  Chapman \& Hall.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{svd}{svd}}, \code{\LinkA{princomp}{princomp}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
(ct <- corresp(~ Age + Eth, data = quine))
## Not run: plot(ct)

corresp(caith)
biplot(corresp(caith, nf = 2))
\end{ExampleCode}
\end{Examples}

