Simple and Canonical Correspondence Analysis

Description

This function performs simple and canonical CA for incomplete tables based on SVD. Different scaling methods for row and column scores are provided.

Usage

1
2
3
4
5
6
7
anacor(tab, ndim = 2, row.covariates, col.covariates, 
scaling = c("Benzecri","Benzecri"), ellipse = TRUE, eps = 1e-06)

## S3 method for class 'anacor'
print(x,...)
## S3 method for class 'anacor'
summary(object,...)

Arguments

tab

Data frame of dimension n times m with frequencies. Missings are coded as NA.

ndim

Number of dimensions.

row.covariates

Matrix with n rows containing covariates for the row scores.

col.covariates

Matrix with m rows containing covariates for the column scores.

scaling

A vector with two elements. The first one corresponds to the method for row scaling, the second one for column scaling. Available scaling methods are "standard", "centroid", "Benzecri", "Goodman".

ellipse

If TRUE, confidence ellipses are computed.

eps

Convergence criterion for reconstitution algorithm.

x

Object of class "anacor" in print.anacor.

object

Object of class "anacor" in summary.anacor.

...

Additional arguments ignored.

Details

Missing values in tab are imputed using the reconstitution algorithm. Setting scaling to "standard" leads to standard coordinates. Principal coordinates can be computed by means of Benzecri decomposition. Furthermore, scores can be scaled around their centroid. Goodman scaling is based on Fisher-Maung decomposition.

For large datasets it is suggested to set ellipse = FALSE. If conf = TRUE, make sure that there are no rows and columns that have full 0 entries.

Value

row.scores

Scaled row scores.

col.scores

Scaled column scores.

ndim

Number of dimensions extracted.

chisq

Total chi-square value.

chisq.decomp

Chi-square decomposition across dimensions with p-values.

singular.values

Singular values without trivial solution.

se.singular.values

Standard errors for the singular values.

left.singvec

Left singular vectors without trivial solution.

right.singvec

Right singular vectors without trivial solution.

eigen.values

Eigenvalues without trivial solution.

datname

Name of the dataset.

tab

Table with imputed frequencies in case of missings.

row.covariates

Matrix with row covariates.

col.covariates

Matrix with column covariates.

scaling

Scaling Method.

bdmat

List of matrices with observed and fitted Benzecri distances for rows and columns.

rmse

Root mean squared error of Bezencri distances (rows and columns).

row.acov

Covariance matrix for row scores.

col.acov

Covariance matrix for column scores.

cancoef

List containing canonical coefficients (CCA only).

sitescores

List containing the site scores (CCA only).

isetcor

List containing the intraset correlations (CCA only).

Author(s)

Jan de Leeuw, Patrick Mair

References

De Leeuw, J. and Mair, P. (2009). Simple and Canonical Correspondence Analysis Using the R Package anacor. Journal of Statistical Software, 31(5), 1-18. http://www.jstatsoft.org/v31/i05/

See Also

plot.anacor

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## simple CA on Tocher data, asymmetric coordinates
data(tocher)
res <- anacor(tocher, scaling = c("standard", "centroid"))
res
summary(res)

## 2- and 5-dimensional solutions for bitterling data, Benzecri scaling
data(bitterling)
res1 <- anacor(bitterling, ndim = 2, scaling = c("Benzecri", "Benzecri"))
res2 <- anacor(bitterling, ndim = 5, scaling = c("Benzecri", "Benzecri"))
res1
res2

## Canonical CA on Maxwell data, Goodman scaling
data(maxwell)
res <- anacor(maxwell$table, row.covariates = maxwell$row.covariates, 
scaling = c("Goodman", "Goodman"))
res
summary(res)