[R] A small error in mca ?

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Jul 11 14:33:21 CEST 2000

> Date: Tue, 11 Jul 2000 14:03:58 +0200
> From: Emmanuel Charpentier <emmanuel.charpentier at sap.ap-hop-paris.fr>
> Dear list,
> Working the example in Stats complements to V&R 3rd ed., I found this :

Please do not send such comments to the R list before consulting the authors,
who might well not even be readers of R-help.

> > library(MASS)
> > library(mva)
> > data(farms)
> > plot(mca(farms,abbrev=TRUE),cex=rep(0.7,2))
> # ... Works OK
> # Sheer curiosity ...
> > plot(mca(farms,abbrev=TRUE,nf=4),cex=rep(0.7,2))
> Error in rep(p * X.svd$d[sec], c(n, n)) : invalid number of copies in "rep"
> A bit of exploration in the MASS source shows (12th line of the mca function
> body) :
>   fs <- X.svd$u[, sec]/rep(p*X.svd$d[sec], c(n,n))
> Shouldn't that be 
>   fs <- X.svd$u[, sec]/rep(p*X.svd$d[sec], rep(n,nf))
> that gives the expected result ?

Probably, depending on who is doing the expecting.  If you look at the
help file you will see that nf=4 is not expected to be useful.

> Oh, BTW : Is mca identical or analogous to Benzecri's "analyse des
> correspondances" (analysis of a chi-squared distance table), or is this yet
> another analysis ?

The document you are reading (skimming?) says in the very first paragraph of
that section:

   Multiple correspondence analysis (MCA) is (confusingly!) a method for
   visualizing the joint properties of $p \ge 2$ categorical variables
   that does \emph{not} reduce to correspondence analysis (CA) for $p =2$,
   although the methods are closely related \citep[see, for

"l'analyse des correspondances" translates as correspondence analysis,
as described in the main text, and you could try looking in the reference,
too, for further elucidation.

Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list