Computation of simple correspondence analysis.
ca(obj, ...)# S3 method for matrix
ca(obj, nd = NA, suprow = NA, supcol = NA,
subsetrow = NA, subsetcol = NA, ...)
# S3 method for data.frame
ca(obj, ...)
# S3 method for table
ca(obj, ...)
# S3 method for xtabs
ca(obj, ...)
# S3 method for formula
ca(formula, data, ...)
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 "xtabs"
or "table"
and one-sided
formulae of the form ~ F1 + F2
, where F1
and F2
are factors.
Number of dimensions to be included in the output; if NA the maximum possible dimensions are included.
Indices of supplementary rows.
Indices of supplementary columns.
Row indices of subset.
Column indices of subset.
A data frame against which to preferentially resolve variables in the formula
Other arguments passed to the ca.matrix
method
Singular values
Dimenson of the solution
Row names
Row masses
Row chi-square distances to centroid
Row inertias
Row standard coordinates
Indices of row supplementary points
Column names
Column masses
Column chi-square distances to centroid
Column inertias
Column standard coordinates
Indices of column supplementary points
The frequency table
The function ca
computes a simple correspondence analysis based on the
singular value decomposition.
The options suprow
and supcol
allow supplementary (passive) rows and columns to be specified.
Using the options subsetrow
and/or subsetcol
result in a subset CA being performed.
Nenadic, O. and Greenacre, M. (2007). Correspondence analysis in R, with two- and three-dimensional graphics: The ca package. Journal of Statistical Software, 20 (3), http://www.jstatsoft.org/v20/i03/
Greenacre, M. (2007). Correspondence Analysis in Practice. Second Edition. London: Chapman & Hall / CRC. Blasius, J. and Greenacre, M. J. (1994), Computation of correspondence analysis, in Correspondence Analysis in the Social Sciences, pp. 53-75, London: Academic Press.
Greenacre, M.J. and Pardo, R. (2006), Subset correspondence analysis: visualizing relationships among a selected set of response categories from a questionnaire survey. Sociological Methods and Research, 35, pp. 193-218.
# NOT RUN {
data("author")
ca(author)
plot(ca(author))
# table method
haireye <- margin.table(HairEyeColor, 1:2)
haireye.ca <- ca(haireye)
haireye.ca
plot(haireye.ca)
# some plot options
plot(haireye.ca, lines=TRUE)
plot(haireye.ca, arrows=c(TRUE, FALSE))
# }
Run the code above in your browser using DataLab