[R] Cummulative Variance in Correspondence Analysis (ADE4)
Stéphane Dray
dray at biomserv.univ-lyon1.fr
Tue Dec 5 17:22:37 CET 2006
Dear Antonio,
if you have questions on the ade4 package, please send email to adelist
(http://listes.univ-lyon1.fr/wws/info/adelist).
The total inertia (variance) of CA is equal to the sum of all eigenvalues :
> data(rpjdl)
> rpjdl.coa <- dudi.coa(rpjdl$fau, scannf = FALSE, nf = 4)
> sum(rpjdl.coa$eig)
[1] 4.468333
This is equal to the chi2 stat divided by the number of individuals:
> chisq.test(rpjdl$fau)$statistic/sum(rpjdl$fau)
X-squared
4.468333
One can obtain the inertia associated to i-th axis by dividing the i-th
eigenvalue by the total inertia. Here are percentages:
> round(rpjdl.coa$eig/sum(rpjdl.coa$eig)*100,2)
[1] 16.86 6.56 5.13 4.58 3.52 3.39 3.37 3.12 2.87 2.72 2.63 2.56
[13] 2.49 2.43 2.34 2.21 2.09 2.00 1.86 1.76 1.61 1.48 1.45 1.43
[25] 1.38 1.26 1.23 1.15 1.14 1.08 1.07 1.01 0.94 0.92 0.89 0.83
[37] 0.77 0.71 0.65 0.61 0.59 0.49 0.47 0.46 0.38 0.36 0.35 0.32
[49] 0.29 0.19
The cumulative inertia is obtained by :
> round(cumsum(rpjdl.coa$eig)/sum(rpjdl.coa$eig)*100,2)
[1] 16.86 23.41 28.55 33.13 36.65 40.03 43.41 46.53 49.39 52.11
[11] 54.75 57.31 59.79 62.23 64.57 66.78 68.87 70.87 72.73 74.49
[21] 76.10 77.58 79.02 80.45 81.83 83.09 84.32 85.47 86.61 87.69
[31] 88.76 89.77 90.71 91.63 92.53 93.36 94.13 94.84 95.49 96.10
[41] 96.69 97.19 97.66 98.12 98.49 98.85 99.20 99.52 99.81 100.00
Antonio Punzon wrote:
> Hi all:
> How can I calculate the cumulative variance (or variance for each component)
> in correspondence analysis?
> If were possible in ADE4 package
> Thank you
>
>
>
> -- Antonio Punzón Merino
> O__---- Instituto Español de Oceanografía
> c/ /'_ --- Centro Oceanográfico de Santander
> (*) \(*) -- Promontorio de San Martín S/N
> ~~~~~~~~~~ 39004-Santander; Spain
> PO BOX: 240
> Tlf: +34 942 29 10 60
> Fax: +34 942 27 50 72
> e-mail: antonio.punzon at st.ieo.es
> web: www.ieo.es <www.ieo.es>
> web: www.sap-ieo.wikispaces.com <www.sap-ieo.wikispaces.com>
> ________________________________________
>
>
>
> La información contenida en este e-mail y sus ficheros adjuntos es totalmente confidencial y no debería ser usado si no fuera usted alguno de los destinatarios. Si ha recibido este e-mail por error, por favor avise al remitente y bórrelo de su buzón o de cualquier otro medio de almacenamiento. This email is confidential and should not be used by anyone who is not the original intended recipient. If you have received this e-mail in error please inform the sender and delete it from your mailbox or any other storage mechanism.
> [[alternative HTML version deleted]]
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> R-help at 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.
>
--
Stéphane DRAY (dray at biomserv.univ-lyon1.fr )
Laboratoire BBE-CNRS-UMR-5558, Univ. C. Bernard - Lyon I
43, Bd du 11 Novembre 1918, 69622 Villeurbanne Cedex, France
Tel: 33 4 72 43 27 57 Fax: 33 4 72 43 13 88
http://biomserv.univ-lyon1.fr/~dray/
More information about the R-help
mailing list