PLOT comp A B C D E F row col
1 3 D 0 0 0 1 0 0 3 1
2 9 A 1 0 0 0 0 0 2 2
3 12 E 0 0 0 0 1 0 5 2
4 17 F 0 0 0 0 0 1 3 3
5 20 A 1 0 0 0 0 0 6 3
6 21 B 0 1 0 0 0 0 7 3
Question: Is C. pentandara (B) associated with variation in bird species composition? Or D & F (both Fabaceae)? Parametric test for differences between independent groups for multiple continuous dependent variables. Like ANOVA for many response variable
Response CA :
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(B) 1 0.2449 0.24494 1.3983 0.2463
Residuals 30 5.2551 0.17517
Response FR :
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(B) 1 0.0062 0.006199 0.0686 0.7952
Residuals 30 2.7125 0.090418
Response GR :
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(B) 1 5.686 5.6862 2.6732 0.1125
Residuals 30 63.814 2.1271
Response HE :
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(B) 1 0.02138 0.021382 0.6771 0.4171
Residuals 30 0.94737 0.031579
Response IN :
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(B) 1 73.65 73.655 2.7977 0.1048
Residuals 30 789.81 26.327
Response NE :
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(B) 1 0.3968 0.39676 1.5655 0.2205
Residuals 30 7.6032 0.25344
Response OM :
Df Sum Sq Mean Sq F value Pr(>F)
as.factor(B) 1 19.44 19.441 1.4069 0.2449
Residuals 30 414.56 13.819
Problem: Most ecological data is overdispersed, has many 0’s or rare species, unequal sample sizes. Solution: Dissimilarity coefficients, permutation tests
PERMANOVA: Permutational multivariate analysis of variance Non-parametric, based on dissimilarities. Allows for partitioning of variability, similar to ANOVA, allowing for complex design (multiple factors, nested design, interactions, covariates).
Uses permutation to compute F-statistic (pseudo-F). Null hypothesis: Groups do not differ in spread or position multivariate space.
PERMANOVA (which is basically adonis()) was found to be largely unaffected by heterogeneity in Anderson & Walsh’s simulations but only for balanced designs.
For unbalanced designs PERMANOVA and ANOSIM were
1.too liberal if the smaller group had greater dispersion, and
2. too conservative if the larger group had greater dispersion.
This result was especially so for ANOSIM.
# sqrt transformationbird.mat<-sqrt(bird.matrix)
Quantify pairwise compositional dissimilarity between sites based on species occurrences.
Bray-Curtis dissimilarity (abundance weighted)
Jaccard (presence/absence)
Gower’s (non-continuous variables)
Dissimilarity: 0 = sites are identical, 1 = sites do not share any species ## When to use :
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Permutation: free
Number of permutations: 9999
adonis2(formula = bird.dist ~ as.factor(birds$DIVERSITY), data = birds, permutations = 9999)
Df SumOfSqs R2 F Pr(>F)
as.factor(birds$DIVERSITY) 1 0.32857 0.12174 4.1585 0.0077 **
Residual 30 2.37033 0.87826
Total 31 2.69890 1.00000
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Betadisper tests whether two or more groups (for example, grazed and ungrazed sites) are homogeneously dispersed in relation to their species in studied samples. This test can be done to see if one group has more compositional variance than another. betadisper() is an implementation of Marti Anderson’s Permdisp method.
Homogeneity of multivariate dispersions
Call: betadisper(d = bird.dist, group = birds$DIVERSITY)
No. of Positive Eigenvalues: 13
No. of Negative Eigenvalues: 13
Average distance to median:
M P
0.2309 0.2531
Eigenvalues for PCoA axes:
(Showing 8 of 26 eigenvalues)
PCoA1 PCoA2 PCoA3 PCoA4 PCoA5 PCoA6 PCoA7 PCoA8
1.28713 0.69577 0.46833 0.37989 0.17181 0.11120 0.07211 0.05095
permutest(dispersion)
Permutation test for homogeneity of multivariate dispersions
Permutation: free
Number of permutations: 999
Response: Distances
Df Sum Sq Mean Sq F N.Perm Pr(>F)
Groups 1 0.00369 0.0036924 0.2231 999 0.64
Residuals 30 0.49659 0.0165530
anova(dispersion)
Analysis of Variance Table
Response: Distances
Df Sum Sq Mean Sq F value Pr(>F)
Groups 1 0.00369 0.0036924 0.2231 0.6401
Residuals 30 0.49659 0.0165530
birdMDS<-metaMDS(bird.mat, distance="bray", k=2, trymax=35, autotransform=TRUE) ##k is the number of dimensions
Run 0 stress 0.1569259
Run 1 stress 0.1572399
... Procrustes: rmse 0.01130213 max resid 0.05306814
Run 2 stress 0.1572399
... Procrustes: rmse 0.01130502 max resid 0.05307926
Run 3 stress 0.1572399
... Procrustes: rmse 0.0113213 max resid 0.05317232
Run 4 stress 0.3886078
Run 5 stress 0.1569259
... Procrustes: rmse 7.862226e-06 max resid 2.095807e-05
... Similar to previous best
Run 6 stress 0.18157
Run 7 stress 0.170243
Run 8 stress 0.158464
Run 9 stress 0.1671135
Run 10 stress 0.1584574
Run 11 stress 0.1703794
Run 12 stress 0.1627566
Run 13 stress 0.1785574
Run 14 stress 0.171026
Run 15 stress 0.1685473
Run 16 stress 0.1673167
Run 17 stress 0.1572399
... Procrustes: rmse 0.01130537 max resid 0.05308626
Run 18 stress 0.1572399
... Procrustes: rmse 0.01130017 max resid 0.05305432
Run 19 stress 0.1671136
Run 20 stress 0.1569259
... New best solution
... Procrustes: rmse 4.837451e-06 max resid 1.545126e-05
... Similar to previous best
*** Solution reached
birdMDS ##metaMDS takes eaither a distance matrix or your community matrix (then requires method for 'distance=')
Call:
metaMDS(comm = bird.mat, distance = "bray", k = 2, trymax = 35, autotransform = TRUE)
global Multidimensional Scaling using monoMDS
Data: bird.mat
Distance: bray
Dimensions: 2
Stress: 0.1569259
Stress type 1, weak ties
Two convergent solutions found after 20 tries
Scaling: centring, PC rotation, halfchange scaling
Species: expanded scores based on 'bird.mat'
NMDS1 NMDS2 R P
CA 0.9420757 -0.3354004 0.07914145 0.276
FR 0.9483046 -0.3173615 0.07799746 0.321
GR 0.3940310 -0.9190972 0.75254539 0.001
HE 0.1394546 -0.9902285 0.04869158 0.455
IN 0.9767994 -0.2141562 0.50831698 0.001
NE 0.2581308 -0.9661100 0.06273997 0.408
OM 0.7868022 0.6172053 0.81929614 0.001
arrows$FG <-rownames(arrows)
# filter P less than 0.05arrows.p<-arrows[arrows$P<0.05,]arrows.p
NMDS1 NMDS2 R P FG
GR 0.3940310 -0.9190972 0.7525454 0.001 GR
IN 0.9767994 -0.2141562 0.5083170 0.001 IN
OM 0.7868022 0.6172053 0.8192961 0.001 OM
arrows.p
NMDS1 NMDS2 R P FG
GR 0.3940310 -0.9190972 0.7525454 0.001 GR
IN 0.9767994 -0.2141562 0.5083170 0.001 IN
OM 0.7868022 0.6172053 0.8192961 0.001 OM
CO the interest is primarily in the similarity among the objects and the individual data variables are of secondary importance. For this reason, the aim of PCO is often described as reduction in dimensionality, while retaining the important information about relationships among a set of objects.