Skip to content
Prev 8466 / 29559 Next

randtest.enfa {adehabitat} -- erratum in calculating the tolerance

On 06/09/2010 09:05 AM, Cl?ment Calenge wrote:
I was a bit too hasty for this reply. Actually the code is incorrect. 
Consider the following code:

pc <- dudi.pca(kasc2df(map)$tab, row.w = dataenfa1$pr/sum(dataenfa1$pr))

This code performs a *centered and scaled* PCA of the environmental 
variables: this analysis first centers and scales the table containing 
the value of the environmental variables. Therefore, for each variable 
of pc$tab, the mean *weighted by the utilization weights* is equal to 
zero and the variance *weighted by the utilization weights* is equal to 
1. Therefore, the sum of the eigenvalues of the PCA on this transformed 
table is equal to the number of environmental variables. This code is 
incorrect (thanks Mathieu for noting the inconsistency). First, to 
calculate the global tolerance, you would need to calculate:

pc <- dudi.pca(kasc2df(map)$tab, scan=FALSE)

This preliminary analysis is performed just to center/scale the 
variables with uniform weighting. This allows to compare the different 
variables in pc$tab (they all have the same average and the same scale). 
*Then*, calculate the weighted and *unscaled* PCA of the table pc$tab:

sum(dudi.pca(pc$tab, scale=FALSE, row.w = 
dataenfa1$pr/sum(dataenfa1$pr), scan=FALSE)$eig)

This gives the tolerance of the species on the area,
Sorry for the confusion,
HTH,

Cl?ment Calenge