Learn R Programming

FactoMineR (version 1.42)

CA: Correspondence Analysis (CA)

Description

Performs Correspondence Analysis (CA) including supplementary row and/or column points.

Usage

CA(X, ncp = 5, row.sup = NULL, col.sup = NULL, 
    quanti.sup=NULL, quali.sup = NULL, graph = TRUE, 
	axes = c(1,2), row.w = NULL, excl=NULL)

Arguments

X

a data frame or a table with n rows and p columns, i.e. a contingency table

ncp

number of dimensions kept in the results (by default 5)

row.sup

a vector indicating the indexes of the supplementary rows

col.sup

a vector indicating the indexes of the supplementary columns

quanti.sup

a vector indicating the indexes of the supplementary continuous variables

quali.sup

a vector indicating the indexes of the categorical supplementary variables

graph

boolean, if TRUE a graph is displayed

axes

a length 2 vector specifying the components to plot

row.w

an optional row weights (by default, a vector of 1 and each row has a weight equals to its margin); the weights are given only for the active rows

excl

numeric vector indicating the indexes of the "junk" columns (default is NULL). Useful for MCA with excl argument.

Value

Returns a list including:

eig

a matrix containing all the eigenvalues, the percentage of variance and the cumulative percentage of variance

col

a list of matrices with all the results for the column variable (coordinates, square cosine, contributions, inertia)

row

a list of matrices with all the results for the row variable (coordinates, square cosine, contributions, inertia)

col.sup

a list of matrices containing all the results for the supplementary column points (coordinates, square cosine)

row.sup

a list of matrices containing all the results for the supplementary row points (coordinates, square cosine)

quanti.sup

if quanti.sup is not NULL, a matrix containing the results for the supplementary continuous variables (coordinates, square cosine)

quali.sup

if quali.sup is not NULL, a list of matrices with all the results for the supplementary categorical variables (coordinates of each categories of each variables, v.test which is a criterion with a Normal distribution, square correlation ratio)

call

a list with some statistics

Returns the row and column points factor map. The plot may be improved using the argument autolab, modifying the size of the labels or selecting some elements thanks to the plot.CA function.

References

Benzecri, J.-P. (1992) Correspondence Analysis Handbook, New-York : Dekker Benzecri, J.-P. (1980) L'analyse des donnees tome 2 : l'analyse des correspondances, Paris : Bordas Greenacre, M.J. (1993) Correspondence Analysis in Practice, London : Academic Press Husson, F., Le, S. and Pages, J. (2009). Analyse de donnees avec R, Presses Universitaires de Rennes. Husson, F., Le, S. and Pages, J. (2010). Exploratory Multivariate Analysis by Example Using R, Chapman and Hall.

See Also

print.CA, summary.CA, ellipseCA, plot.CA, dimdesc, Video showing how to perform CA with FactoMineR

Examples

Run this code
# NOT RUN {
data(children)
res.ca <- CA (children, row.sup = 15:18, col.sup = 6:8)
summary(res.ca)
## Ellipses for all the active elements
ellipseCA(res.ca)
## Ellipses around some columns only
ellipseCA(res.ca,ellipse="col",col.col.ell=c(rep("blue",2),rep("transparent",3)),
     invisible=c("row.sup","col.sup"))
# }

Run the code above in your browser using DataLab