Docsity
Docsity

Prepara tus exámenes
Prepara tus exámenes

Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity


Consigue puntos base para descargar
Consigue puntos base para descargar

Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium


Orientación Universidad
Orientación Universidad


Análisis de Asociación y Correlación entre Especies en Ecología: Sesión 9 Innova Docentia , Apuntes de Ecología

En este documento, se presenta un proyecto educativo de innova docentia que enseña a los estudiantes cómo utilizar técnicas numéricas para identificar comunidades vegetales en el sitio de estudio (morata de tajuña), mediante el análisis de contingencia tabular y pruebas de correlación. El documento proporciona instrucciones paso a paso para realizar el análisis de chi-square y el análisis de correlación pearson entre pares de especies en las pendientes norte y sur. El objetivo final es construir una matriz de asociación de especies.

Tipo: Apuntes

2016/2017

Subido el 22/06/2017

usuario desconocido
usuario desconocido 🇪🇸

3.6

(83)

81 documentos

1 / 4

Toggle sidebar

Esta página no es visible en la vista previa

¡No te pierdas las partes importantes!

bg1
PROYECTO INNOVA DOCENTIA: Internacionalización de los recursos
educativos de la asignatura de Ecología y adaptación al Espacio Superior de
Educación Europeo (EEES). (Ref 240; http//web.bioucm.es/innovadoc)
SESSION 9: ASSOCIATION AND CORRELATION BETWEEN SPECIES
In this practice you will learn how to use different numerical techniques to identify plant
communities, in the site of study (Morata de Tajuña). You will use statistical inference such
as Chi-square and correlation tests, taking species by pairs, in each slope. Remember,
that the null hypothesis, H0, is the independence (no association between species).
IMPORTANT: In this practice you will only consider the following species: Carex
halleriana, Cistus clusii, Genista scorpius, Jasminum fruticans, Stipa tenacissima, Quercus
coccifera, Rosmarinus officinalis, Teucrium pseudochamaepitys and Thymus spp.
Activity 1.- Quantifying the association between species
By means of the analysis of contingency tables through Chi-square, you will test whether
there is a significant association (positive or negative) between pairs of species.
Contingency tables are built using presence/absence data of plant species (categorical data),
so first of all you must convert your quantitative data (lineal cover) into categorical data.
Now, let’s start!!
Double click in the file called “Session 9”, inside the folder “INNOVA”
Save this file with your own name: filesave asOKselect folderwrite the name
First, you must load your data matrix typing the following command:
setwd("C:/Users/Prácticas/Desktop/INNOVA") ### Write the route of the
folder where you will keep and read your data.
data<-read.table("data.txt",header=TRUE) ### read your main matrix
View(data) ### visualize the matrix (you can repeat this command whenever
you want to visualize matrices)
north<-subset(data,transect=="north") ### create a sub-matrix of the north
slope
View(north) ### visualize the matrix
south<-subset(data,transect=="south") ### create a sub-matrix of the south
slope
View(south) ### visualize the matrix
Now, let’s start the analysis of the north slope (just the north!!!)
north_P<-as.data.frame(ifelse(north<0.001,0,1)) ### create a new matrix
transforming quantitative data in data of presence (1), absence (0).
Let’s do an example with a pair of species (Carex halleriana and Cistus clusii)
chi<-chisq.test(north_P$car_hal,north_P$cis_clu) ### Analyze presence,
absence data by means of chi square test of two species
chi ### summary of the analysis
chi$observed ### see table of observed values
1
INNOVA Ref 240
pf3
pf4

Vista previa parcial del texto

¡Descarga Análisis de Asociación y Correlación entre Especies en Ecología: Sesión 9 Innova Docentia y más Apuntes en PDF de Ecología solo en Docsity!

PROYECTO INNOVA DOCENTIA: Internacionalización de los recursos educativos de la asignatura de Ecología y adaptación al Espacio Superior de Educación Europeo (EEES). (Ref 240; http//web.bioucm.es/innovadoc)

SESSION 9: ASSOCIATION AND CORRELATION BETWEEN SPECIES

In this practice you will learn how to use different numerical techniques to identify plant communities, in the site of study (Morata de Tajuña). You will use statistical inference such as Chi-square and correlation tests, taking species by pairs, in each slope. Remember, that the null hypothesis, H0, is the independence (no association between species).

IMPORTANT: In this practice you will only consider the following species: Carex halleriana, Cistus clusii, Genista scorpius, Jasminum fruticans, Stipa tenacissima, Quercus coccifera, Rosmarinus officinalis, Teucrium pseudochamaepitys and Thymus spp.

Activity 1.- Quantifying the association between species

By means of the analysis of contingency tables through Chi-square, you will test whether there is a significant association (positive or negative) between pairs of species. Contingency tables are built using presence/absence data of plant species (categorical data), so first of all you must convert your quantitative data (lineal cover) into categorical data.

Now, let’s start!!

Double click in the file called “Session 9”, inside the folder “INNOVA”

Save this file with your own name: filesave asOKselect folderwrite the name

First, you must load your data matrix typing the following command:

setwd("C:/Users/Prácticas/Desktop/INNOVA") ### Write the route of the folder where you will keep and read your data. data<-read.table("data.txt",header=TRUE) ### read your main matrix View(data) ### visualize the matrix (you can repeat this command whenever you want to visualize matrices) north<-subset(data,transect=="north") ### create a sub-matrix of the north slope View(north) ### visualize the matrix south<-subset(data,transect=="south") ### create a sub-matrix of the south slope View(south) ### visualize the matrix

Now, let’s start the analysis of the north slope (just the north!!!)

north_P<-as.data.frame(ifelse(north<0.001,0,1)) ### create a new matrix transforming quantitative data in data of presence (1), absence (0).

Let’s do an example with a pair of species ( Carex halleriana and Cistus clusii )

chi<-chisq.test(north_P$car_hal,north_P$cis_clu) ### Analyze presence, absence data by means of chi square test of two species chi ### summary of the analysis chi$observed ### see table of observed values

1

chi$expected ### see table of expected frequencies

Using R, you can save time by comparing all species with all species with just a few commands. Great, isn’t it?

First you must prepare the data

drop.factors<-c("plot","transect","slope") ### Tell which factors must be removed north_P1<-north_P[ , !(names(north_P) %in% drop.factors)] ### Remove factors drop.species.north<-c("gen_sco","que_coc","ros_off") ### Tell which species are absent or present in all observations of the north slope, and must be removed. north_P2<-north_P1[ , !(names(north_P1) %in% drop.species.north)] ### Remove species that you told in the command above View(north_P2) ### check that these species and factors have been removed. chinorth<- combn(ncol(north_P2),2) ### create a matrix combining the species two by two, by pairs. install.packages ("plyr") ### install a package that has the function “adply”, You can use this function to do the chi square test for all combinations of species at the same time. YOU SAVE TIME!!!! AND TIME IS MONEY!!!$$$$ If you want more information, you can type: help(plyr) library ("plyr") ### load the library

Now, let’s do the loop

allchinorth<-adply(chinorth, 2, function(x) { test <- chisq.test(north_P2[, x[1]], north_P2[, x[2]]) out <- data.frame("Row" = colnames(north_P2)[x[1]] ,"Column" = colnames(north_P2[x[2]]) ,"Chi.Square" = test$statistic ,"df"= test$parameter ,"p.value" = test$p.value ,"observed"=test$observed ,"expected"=test$expected) return(out) })

Let’s see the results and interpret the associations between species of the north slope

View(allchinorth)

REMEMBER REPEATING THIS ANALYSIS FOR SPECIES OF THE SOUTH SLOPE!!!! To do this, you must create new matrices: south_P, south_P1, south_P (removing species of the south slope*), chisouth AND allchisouth

2

write.table(corr.N$P,"p value north.txt") ### IDEM

OPTIONAL: IF YOU WANT, YOU CAN READ FILES.TXT FROM EXCEL. LET’S

TRY!!!

  1. Open an Excel sheet
  2. File Open all files
  3. Open .txt that we just created (“r value north.txt”)
  4. Delimitadosmarcar "espacio"siguientefinalizar
  5. Pinchar en casilla A1botón derechoinsertardesplazar celdas a la derecha.

REMEMBER REPEATING THIS ANALYSIS FOR SPECIES OF THE SOUTH

SLOPE!!!! To do this, you must create new matrices: south_C, corr_S, corr.S$r, corr.S $P.

You can create a table similar to the one you have made with the association results.

4