[R-sig-Geo] enfa-gnesfa details (adehabitat)

Clément Calenge clement.calenge at gmail.com
Fri Jun 4 09:14:03 CEST 2010


> In the Gnesfa paper, when you explain the examples and compare the
> eigenvalues of the 3 analysis, you mentioned a significance test for the
> eigenvalues. For example, at the end of page 680: "Indeed, the tests of the
> first (γ1 = 1.61, P<0.002) and of the last eigenvalue (γ6 = 0.53, P<0.002)
> were both significant." I don't know if I miss it (I'm sorry if I did!!),
> but I don't know where did you get those tests from? Are they implemented in
> adehabitat too?
>    

No, they are not implemented, but they are easy to implement. Imagine 
that pc is the object containing the PCA of the table of the values of 
environmental variables (columns) in each pixel (rows), and that wei is 
the vector describing the utilization weight of each pixel. Then you can 
perform the test (e.g. for the FANTER) in this way:

## observed first eigenvalue:
obs <- gnesfa(pc, Focus=wei, scan=FALSE)$eig[1]
## randomized datasets:
sim <- sapply(1:500, function(i) {
     weir <- sample(wei)
     gnesfa(pc, Focus=weir, scan=FALSE)$eig[1]
})
## The randomization test
ran <- as.randtest(sim, obs)
ran
plot(ran)

Note that this tests relies on the hypothesis of independence between 
the pixels (e.g. no "contagion" of the utilization weights between 
neighbour pixels, so no social attraction, etc.)


> Another thing, in the MADIFA paper -Calenge et al (2008)-, you tested the
> habitat selection value (θ1 = 3.7, P<  0.002, pag 561) with a Monte Carlo
> test. Is it like the renfa function? Again, can I find it in adehabitat?
>    

No, it is not available, but it is similar to the renfa function. To 
perform it, use the same code as above, but replace "Focus=weir" by 
"Reference=weir"


> Regarding the goodness of fit you used, is it implemented in adehabitat? The
> Fig.4 of that paper reminds me AUC plots, are they equivalent?
>    


No they are not equivalent. Have a look at Knick and Dyer for a more 
detailed description (1997, Distribution of black-tailed jackrabbit 
habitat use areas in changing landscapes using the Mahalanobis distance 
statistic, Journal of Wildlife Management, 61: 75-85). They are not 
implemented in adehabitat. They are easy to obtain. If "ma" is your 
object containing the results of the MADIFA, you can draw such a graph by:

## for the approximate Mahalanobis distances
x <- seq(0,1,length=100)
plot(quantile(sort(ma$mahasu), x), x, ty="l", xlab="Mahalanobis 
distances", ylab="Quantiles")

And similarly for other approaches.


> Just two last details... In Calenge et al (2008) you mentioned the inertia
> ratio, but I'm not sure where I can find it in the output of madifa/fanter?
>    

The inertia ratio for each factorial axis is simply the corresponding 
eigenvalue. The inertia ratio for the first axis is the first 
eigenvalue, etc.


> And about enfa, the output gives the global marginality, but, where can I
> find the global specialization or global tolerance?
>    

The "global specialization" does not exist. The specialization 
corresponds to the ratio
variance of available weights/variance of utilization weights
measured on a variable (or a direction of the ecological space). 
Therefore, it is an
unidimensional measure, and cannot be measured globally over the 
ecological space.
The tolerance is just the sum of the variances of utilization weights 
over all the variables.
If "tab" is the dataframe containing the values of environmental 
variables (columns) in each pixel (rows), and that wei is as above the 
vector describing the utilization weight of each pixel, you can 
calculate the tolerance with:

sum(dudi.pca(tab, row.w=wei, scan=FALSE)$eig)

HTH,

Clément Calenge

-- 
Clément CALENGE
Cellule d'appui à l'analyse de données
Office national de la chasse et de la faune sauvage
Saint Benoist - 78610 Auffargis
tel. (33) 01.30.46.54.14



More information about the R-sig-Geo mailing list