Re: [R] Correspondence analysis with R -follow up

From: Gavin Simpson <gavin.simpson_at_ucl.ac.uk>
Date: Fri 21 Jul 2006 - 18:10:56 EST

On Thu, 2006-07-20 at 16:40 +0000, Emanuele Mazzola wrote:
> Hi all,
>
> thank you for your answers; i've tried both cca from vegan library, and
> dudi.coa from ade4 library; one last question: my deal is mainly with
> contingency tables, like the one i'm posting here
>
> acciaieria<-c(.41,.02,.44,.04,.09)
> laminatoio<-c(.34,.28,.26,.01,.11)
> fonderia<-c(.48,.05,.34,.08,.05)
> leghe<-c(.45,.19,.25,.03,.08)
> pct<-cbind(acciaieria,laminatoio,fonderia,leghe)
> pct<-data.frame(pct,row.names=c("normale","preparaz.","manutenz.","installaz.","trasferim."))
>
> BUT...cca and dudi.coa seem to return quite different graphical results;
> where am i doing wrong?
> Do they do the same to you with the table above?
>
> Thank you very much again!
> Bye
> Emanuele

Hi, I haven't used ade4 at all, but as long as you did CA correctly using ade4 functions, I doubt the plotted results differ really in all but cosmetic ways or perhaps in terms of the scalings used.

You are plotting two bits of information in the biplot and you can only represent one of those optimally, or you could compromise and plot with symmetric scaling. Or you could plot them in a multitude of ways - there are whole books on biplots!

Take a look at argument scaling in ?plot.cca (for vegan). Try plotting your CA with different scalings and see if that better matches the CA from ade4, eg:

library(vegan)
mod <- cca(pct)

plot(mod) # default is scaling = 2
plot(mod, scaling = 1)
plot(mod, scaling = 3)

If using vegan, you might want to look at Jari Oksanens Vegan Tutorial for more info on using his functions:

http://cc.oulu.fi/~jarioksa/opetus/metodi/vegantutor.pdf

If this doesn't help your understanding or problem, post back with the ade4 and vegan code you are using and I'll have a look.

G

-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 *Note new Address and Fax and Telephone numbers from 10th April 2006*
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson                     [t] +44 (0)20 7679 0522
ECRC                              [f] +44 (0)20 7679 0565
UCL Department of Geography
Pearson Building                  [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street
London, UK                        [w] http://www.ucl.ac.uk/~ucfagls/cv/
WC1E 6BT                          [w] http://www.ucl.ac.uk/~ucfagls/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri Jul 21 18:15:13 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 21 Jul 2006 - 20:16:49 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.