User Tools

Site Tools


en:rda_cca_examples

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:rda_cca_examples [2019/01/26 18:37]
David Zelený
en:rda_cca_examples [2019/03/07 21:16] (current)
David Zelený
Line 1: Line 1:
-====== Ordination analysis ====== +Section: [[en:​ordination]] 
-===== RDA, tb-RDA & CCA (constrained ordination) =====+===== RDA, tb-RDA, CCA db-RDA ​(constrained ordination) =====
  
 [[{|width: 7em; background-color:​ white; color: navy}rda_cca|Theory]] [[{|width: 7em; background-color:​ white; color: navy}rda_cca|Theory]]
Line 7: Line 7:
 [[{|width: 7em; background-color:​ white; color: navy}rda_cca_exercise|Exercise {{::​lock-icon.png?​nolink|}}]] [[{|width: 7em; background-color:​ white; color: navy}rda_cca_exercise|Exercise {{::​lock-icon.png?​nolink|}}]]
  
-==== Example 1: Vltava river valley dataset (RDA) ==== +==== Example 1: Vltava river valley dataset (tb-RDA) ==== 
-In this example, we will apply constrained ordination on [[en:​data:​vltava|Vltava river valley dataset]]. We will ask how much variance in species composition can be explained by two variables, soil pH and soil depth. Both are important factors for plant growth, and moreover, in the study area, they are somewhat correlated (shallower soils have lower pH since the prevailing geological substrate is acid).+In this example, we will apply constrained ordination ​(tb-RDA) ​on [[en:​data:​vltava|Vltava river valley dataset]]. We will ask how much variance in species composition can be explained by two variables, soil pH and soil depth. Both are important factors for plant growth, and moreover, in the study area, they are somewhat correlated (shallower soils have lower pH since the prevailing geological substrate is acid).
  
 First, upload the Vltava river valley data: First, upload the Vltava river valley data:
Line 20: Line 20:
 </​code>​ </​code>​
   ​   ​
-Upload library ''​vegan''​ and calculate tb-RDA based on Hellinger pre-transformed species composition data. Note that since the original data represent estimates of percentage cover, it is better to log transform these values first before Hellinger transformation is done:+Upload library ''​vegan''​ and calculate tb-RDA based on Hellinger pre-transformed species composition data. Note that since the original data represent estimates of percentage cover, it is better to log transform these values first before Hellinger transformation is done (using function ''​log1p'',​ which calculates //log (x+1)// to avoid //log (0)//):
 <code rsplus> <code rsplus>
 library (vegan) library (vegan)
Line 28: Line 28:
 tbRDA tbRDA
 </​code>​ </​code>​
 +
 +The result printed by ''​rda''​ function is the following:
 <​code>​ <​code>​
 Call: rda(formula = spe.hell ~ pH + SOILDPT, data = env) Call: rda(formula = spe.hell ~ pH + SOILDPT, data = env)
Line 47: Line 49:
 </​code>​ </​code>​
  
-The two variables explain 8.9% of the variance (the row ''​Constrained''​ and column ''​Proportion''​ in the table above, can be calculated also as the sum of eigenvalues for the constrained axes divided by total variance (inertia): (0.04023+0.02227) /0.70476=0.08868. The first constrained axis (RDA1) explains 0.04023/​0.70476=5.7% of the variance, while the second (RDA2) explains 0.02227/​0.70476=3.2%. Note that the first unconstrained axis (PC1) represents 0.07321/​0.70476=10.4% of total variance, which is more than both explanatory variables together; the first two unconstrained explain (0.07321+0.04857)/​0.70476=17.3%. This means that the dataset may be structured by some strong environmental variable(s) different from pH and soil depth (we will check this below).+and, the same with comments: 
 + 
 +{{:​obrazky:​rda-vltava-dataset-ph_soildpt.jpg?​direct|}} 
 + 
 +The two variables explain 8.9% of the variance (the row ''​Constrained''​ and column ''​Proportion''​ in the table above, can be calculated also as the sum of eigenvalues for the constrained axes divided by total variance (inertia): (0.04023+0.02227) /0.70476=0.08869. The first constrained axis (RDA1) explains 0.04023/​0.70476=5.7% of the variance, while the second (RDA2) explains 0.02227/​0.70476=3.2%. Note that the first unconstrained axis (PC1) represents 0.07321/​0.70476=10.4% of total variance, which is more than both explanatory variables together; the first two unconstrained explain (0.07321+0.04857)/​0.70476=17.3%. This means that the dataset may be structured by some strong environmental variable(s) different from pH and soil depth (we will check this below). 
 + 
 +The relationship between the variation represented by individual (constrained and unconstrained) ordination axes can be displayed using the barplot on eigenvalues:​ 
 +<code rsplus>​ 
 +constrained_eig <- tbRDA$CCA$eig/​tbRDA$CA$tot.chi*100 
 +unconstrained_eig <- tbRDA$CA$eig/​tbRDA$CA$tot.chi*100 
 +barplot (c(constrained_eig,​ unconstrained_eig),​ col = c(rep ('​red',​ length (constrained_eig)),​ rep ('​black',​ length (unconstrained_eig))),​ las = 2, ylab = '% variation'​) 
 +</​code>​ 
 + 
 +(note that all information about the eigenvalues and total inertia is in the object calculated by ''​vegan'''​s ordination function (''​rda''​ in this case, stored in the list ''​tbRDA''​),​ you just need to search a bit inside to find it - consider using the function ''​str''​ to check the structure of tbRDA first). 
 + 
 +{{:​obrazky:​tb_rda_vltava_barplot_eig.png?​direct|}} 
  
 Let's see the ordination diagram: Let's see the ordination diagram:
en/rda_cca_examples.1548499029.txt.gz · Last modified: 2019/01/26 18:37 by David Zelený