Last data update: 2014.03.03

R: Multiple Correspondence Analysis
mcaR Documentation

Multiple Correspondence Analysis

Description

Computes a multiple correspondence analysis of a set of factors.

Usage

mca(df, nf = 2, abbrev = FALSE)

Arguments

df

A data frame containing only factors

nf

The number of dimensions for the MCA. Rarely 3 might be useful.

abbrev

Should the vertex names be abbreviated? By default these are of the form ‘factor.level’ but if abbrev = TRUE they are just ‘level’ which will suffice if the factors have distinct levels.

Value

An object of class "mca", with components

rs

The coordinates of the rows, in nf dimensions.

cs

The coordinates of the column vertices, one for each level of each factor.

fs

Weights for each row, used to interpolate additional factors in predict.mca.

p

The number of factors

d

The singular values for the nf dimensions.

call

The matched call.

References

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.

See Also

predict.mca, plot.mca, corresp

Examples

farms.mca <- mca(farms, abbrev=TRUE)
farms.mca
plot(farms.mca)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MASS)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MASS/mca.Rd_%03d_medium.png", width=480, height=480)
> ### Name: mca
> ### Title: Multiple Correspondence Analysis
> ### Aliases: mca print.mca
> ### Keywords: category multivariate
> 
> ### ** Examples
> 
> farms.mca <- mca(farms, abbrev=TRUE)
> farms.mca
Call:
mca(df = farms, abbrev = TRUE)

Multiple correspondence analysis of 20 cases of 4 factors

Correlations 0.806 0.745  cumulative % explained 26.87 51.71 
> plot(farms.mca)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>