[R-sig-eco] how are compuetd the species scores of pca from vegan package ?

2014-05-27 Thread claire della vedova
Hi everybody,

I'm working on PCA approach, and comparing outputs from ade4 and vegan
packages.
I'm ok with the normalization of the variables coordinates coming from ade4
outputs.
(with $co : coordinates are scaled to eigen values ; with  $c1 : coordinates
are scaled to 1).

But I have difficulties to understand how are computed the Species scores in
vegan's outputs with scaling 1 or 2 options, and what means  the message
concerning scaling, especially about the 'General scaling constant of
scores'.
For example :

'Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  4.226177 '
'

I've search on the archives of R-sig-ecology , cross validate and
stackoverflow, and found nothing that helped me. If somebody has some
information about it, I would greatly appreciate some help.
All the best.

Claire Della Vedova

Here some parts of my code :


library(ade4)
library(vegan)

doubs.env - read.csv
('http://www.sci.muni.cz/botany/zeleny/wiki/anadat-r/data
   -download/DoubsEnv.csv', row.names = 1)

## with ade4 ##
pca.ad-dudi.pca(doubs.env, scale = TRUE, center = TRUE, scann = FALSE,nf=3)

# eigen value of the fisrt eigen vector
pca.ad$eig[1]
[1] 5.968749

#variables coordinates in first eigen vector
pca.ad$co[,1]
[1]  0.85280863 -0.81918008 -0.4528  0.75214647 -0.04996375  0.70722171
 [7]  0.83048310  0.90260821  0.79011263 -0.76485397  0.76373149


#check the normalization of laodings
sum(pca.ad$co[,1]^2)
[1] 5.968749
#= coordinatesscaled to eigen values

#variables normed scores in first eigen vector
pca.ad$c1[,1]
[1]  0.34906791 -0.33530322 -0.18535177  0.30786532 -0.02045094  0.28947691
 [7]  0.33992972  0.36945166  0.32340546 -0.31306670  0.31260725


#check the normalization
sum(pca.ad$c1[,1]^2)
[1] 1
#= coordinates scaled to 1

## with vegan ##
pca.veg-rda(doubs.env, scale = TRUE)

# species scores for the fisrt eigen vector, with sacling 1
summary(pca.veg, scaling=1)
  dasaltpendeb pHdurpho 
 1.4752228 -1.4170507 -0.7833294  1.3010933 -0.0864293  1.2233806  1.4366031 
   nitammoxydbo 
 1.5613681  1.3667687 -1.3230752  1.3211335 

'Scaling 1 for species and site scores
* Sites are scaled proportional to eigenvalues
* Species are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  4.226177 
'



summary(pca.veg, scaling=2)[1][[1]][,1]
das alt pen deb  pH dur 
1.08668311 -1.04383225 -0.57701847  0.95841533 -0.06366582  0.90117039 
pho nit amm oxy dbo 
1.05823501  1.15013974  1.00679334 -0.97460773  0.97317743 
'Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  4.226177 '




--
View this message in context: 
http://r-sig-ecology.471788.n2.nabble.com/how-are-compuetd-the-species-scores-of-pca-from-vegan-package-tp7578918.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] how are compuetd the species scores of pca from veganpackage ?

2014-05-27 Thread Jari Oksanen
Dear Claire Della Vedova,

It seems that you have searched in many places, except in vegan documentation. 
Look at the vignette on Design decisions, section Scaling in redundancy 
analysis.

Cheers, Jari Oksanen

From: r-sig-ecology-boun...@r-project.org r-sig-ecology-boun...@r-project.org 
on behalf of claire della vedova claire.della-ved...@magelisgroup.com
Sent: 27 May 2014 11:17
To: r-sig-ecology@r-project.org
Subject: [R-sig-eco] how are compuetd the species scores of pca from 
veganpackage ?

Hi everybody,

I'm working on PCA approach, and comparing outputs from ade4 and vegan
packages.
I'm ok with the normalization of the variables coordinates coming from ade4
outputs.
(with $co : coordinates are scaled to eigen values ; with  $c1 : coordinates
are scaled to 1).

But I have difficulties to understand how are computed the Species scores in
vegan's outputs with scaling 1 or 2 options, and what means  the message
concerning scaling, especially about the 'General scaling constant of
scores'.
For example :

'Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  4.226177 '
'

I've search on the archives of R-sig-ecology , cross validate and
stackoverflow, and found nothing that helped me. If somebody has some
information about it, I would greatly appreciate some help.
All the best.

Claire Della Vedova

Here some parts of my code :


library(ade4)
library(vegan)

doubs.env - read.csv
('http://www.sci.muni.cz/botany/zeleny/wiki/anadat-r/data
   -download/DoubsEnv.csv', row.names = 1)

## with ade4 ##
pca.ad-dudi.pca(doubs.env, scale = TRUE, center = TRUE, scann = FALSE,nf=3)

# eigen value of the fisrt eigen vector
pca.ad$eig[1]
[1] 5.968749

#variables coordinates in first eigen vector
pca.ad$co[,1]
[1]  0.85280863 -0.81918008 -0.4528  0.75214647 -0.04996375  0.70722171
 [7]  0.83048310  0.90260821  0.79011263 -0.76485397  0.76373149


#check the normalization of laodings
sum(pca.ad$co[,1]^2)
[1] 5.968749
#= coordinatesscaled to eigen values

#variables normed scores in first eigen vector
pca.ad$c1[,1]
[1]  0.34906791 -0.33530322 -0.18535177  0.30786532 -0.02045094  0.28947691
 [7]  0.33992972  0.36945166  0.32340546 -0.31306670  0.31260725


#check the normalization
sum(pca.ad$c1[,1]^2)
[1] 1
#= coordinates scaled to 1

## with vegan ##
pca.veg-rda(doubs.env, scale = TRUE)

# species scores for the fisrt eigen vector, with sacling 1
summary(pca.veg, scaling=1)
  dasaltpendeb pHdurpho
 1.4752228 -1.4170507 -0.7833294  1.3010933 -0.0864293  1.2233806  1.4366031
   nitammoxydbo
 1.5613681  1.3667687 -1.3230752  1.3211335

'Scaling 1 for species and site scores
* Sites are scaled proportional to eigenvalues
* Species are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  4.226177
'



summary(pca.veg, scaling=2)[1][[1]][,1]
das alt pen deb  pH dur
1.08668311 -1.04383225 -0.57701847  0.95841533 -0.06366582  0.90117039
pho nit amm oxy dbo
1.05823501  1.15013974  1.00679334 -0.97460773  0.97317743
'Scaling 2 for species and site scores
* Species are scaled proportional to eigenvalues
* Sites are unscaled: weighted dispersion equal on all dimensions
* General scaling constant of scores:  4.226177 '




--
View this message in context: 
http://r-sig-ecology.471788.n2.nabble.com/how-are-compuetd-the-species-scores-of-pca-from-vegan-package-tp7578918.html
Sent from the r-sig-ecology mailing list archive at Nabble.com.

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology