(standardized) explanatory variables to the discrimination of objects. The example
below shows both operations (identification and discrimination).
To perform LDA, one must ensure that the within-group covariance matrices of
the explanatory variables are homogeneous, a condition that is frequently violated
with ecological data. We will address this step with function betadisper() of
package vegan. The null hypothesis of the betadisper test is H 0 : the multivariate
group dispersion matrices are homogeneous. A p-value larger than 0.05 indicates a
high probability of conformity of the data to H 0 . Furthermore, an often-neglected
preliminary step is to test if the explanatory variables indeed have different means
among the groups defined by the response variable. This test, based on Wilks’
lambda, is actually the overall test performed in parametric MANOVA (Legendre
and Legendre, 2012). We will compute this test using two different functions in R.
6.5.2 Discriminant Analysis Using lda()
lda() is a function of package MASS. As a simple example, we can use the fourgroup classification of sites based on the fish species (gr in the 3D plots above), and
try to explain this classification using the three environmental variables that have
been selected in Sect. 6.3.2.6: ele, oxy and bod. Function lda() accepts
quantitative and binary dummy variables in the explanatory matrix, but its documentation file warns against the use of explanatory variables of class “factor”.
Preliminary steps: compute homogeneity of group dispersions and Wilks’
lambda test.
# Ward clustering result of Hellinger-transformed species data,
# cut into 4 groups
gr <- cutree(hclust(vegdist(spe.hel, "euc"), "ward.D2"), k = 4)
# Environmental matrix with only 3 variables (ele, oxy and bod)
env.pars2 <- as.matrix(env2[, c(1, 9, 10)])
# Verify multivariate homogeneity of within-group covariance
# matrices using the betadisper() function {vegan}
env.pars2.d1 <- dist(env.pars2)
(env.MHV <- betadisper(env.pars2.d1, gr))
permutest(env.MHV) # Permutational test
The within-group covariance matrices are not homogeneous. Let us try a log
transformation of variables ele and bod
264
6 Canonical Ordination
Précédent

- 276/444

Suivant