Learn R Programming

dimensio (version 0.10.1)

ca: Correspondence Analysis

Description

Computes a simple correspondence analysis based on the singular value decomposition.

Usage

ca(object, ...)

# S4 method for data.frame ca(object, rank = NULL, sup_row = NULL, sup_col = NULL)

# S4 method for matrix ca(object, rank = NULL, sup_row = NULL, sup_col = NULL)

Value

A CA object.

Arguments

object

A \(m \times p\) numeric matrix or a data.frame.

...

Currently not used.

rank

An integer value specifying the maximal number of components to be kept in the results. If NULL (the default), \(min(m, p) - 1\) components will be returned.

sup_row

A vector specifying the indices of the supplementary rows.

sup_col

A vector specifying the indices of the supplementary columns.

Author

N. Frerebeau

References

Greenacre, M. J. Theory and Applications of Correspondence Analysis. London: Academic Press, 1984.

Greenacre, M. J. Correspondence Analysis in Practice. Seconde edition. Interdisciplinary Statistics Series. Boca Raton: Chapman & Hall/CRC, 2007.

Lebart, L., Piron, M. and Morineau, A. Statistique exploratoire multidimensionnelle: visualisation et inférence en fouille de données. Paris: Dunod, 2006.

See Also

svd()

Other multivariate analysis: mca(), pca(), pcoa(), predict()

Examples

Run this code
## Data from Lebart et al. 2006, p. 170-172
data("colours")

## The chi square of independence between the two variables
stats::chisq.test(colours)

## Compute correspondence analysis
X <- ca(colours)

## Plot rows
viz_rows(X, labels = TRUE)

## Plot columns
viz_columns(X, labels = TRUE)

## Get row coordinates
get_coordinates(X, margin = 1)

## Get column coordinates
get_coordinates(X, margin = 2)

## Get total inertia
sum(get_inertia(X))

## Get row contributions
get_contributions(X, margin = 1)

Run the code above in your browser using DataLab