data analysis talk_jan2015

32
The Analysis of Ecological Data Juan Antonio Balbuena Marine Zoology Unit (ICBiBE, UV) [email protected] Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos Continentais Curso de Pós-graduação em Biologia Comparada Institut Cavanilles de Biodiversitat i Biologia Evolutiva

Upload: juan-antonio-balbuena

Post on 13-Apr-2017

127 views

Category:

Science


0 download

TRANSCRIPT

Page 1: Data analysis talk_jan2015

The Analysis of Ecological Data

Juan Antonio BalbuenaMarine Zoology Unit (ICBiBE, UV)[email protected]

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Institut Cavanilles de Biodiversitat i Biologia Evolutiva

Page 2: Data analysis talk_jan2015

Contents

1.Multivariate data in ecology

2.Functional vs. structural methods

3.Inference and modelling

4.Further readingJan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 3: Data analysis talk_jan2015

Multivariate data in ecology

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 4: Data analysis talk_jan2015

The usual starting point is a data matrix

Multivariate data in ecologycode FishSp Sex SL W POLYCH COPEP MOLLU AMPHIP DECAPB1B3D107 barba 0 16.1 104.0 10 5 5 5 1

B1B3D108 barba 1 13.1 50.0 6 0 0 3 3

B1B3D109 barba 0 16.0 86.0 0 0 0 1 1

B1O1D103 barba 1 11.5 33.0 0 0 0 3 3

B3O1D302 barba 0 15.8 95.0 0 1 0 1 1B3O1D303 barba 0 17.8 133.0 0 0 0 2 4B3O1D304 barba 0 15.9 90.0 2 0 0 4 4

B3O1D305 barba 0 17.1 170.0 17 0 0 14 14

B3O1D306 barba 1 18.9 164.0 14 0 0 2 2

B3O1D307 barba 1 16.1 86.0 0 0 0 2 2

B3O1D308 barba 1 19.3 168.0 0 0 0 11 0B3O1D309 barba 1 19.4 159.0 5 0 0 9 9

B3O1D310 barba 1 16.6 108.0 0 0 0 7 7

SB013 surm 0 12.0 41.0 3 0 0 1 1

SBJ10 surm 0 12.5 49.1 0 0 0 2 2

SBJ11 surm 0 15.8 101.0 0 6 0 6 6

SBJ13 surm 1 15.5 97.0 0 0 0 5 0

SBJ14 surm 1 16.0 111.5 0 1 0 1 1SBJ17 surm 0 14.5 71.1 5 0 0 2 2

SBJ19 surm 1 14.7 83.1 0 0 0 2 2

SBJ20 surm 1 14.8 85.8 2 4 0 4 4

SSJ11 surm 0 17.8 139.5 0 0 0 2 0

SSJ12 surm 0 16.5 108.9 10 0 0 4 4

Stomach contents

Mullus spp.

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 5: Data analysis talk_jan2015

There are different types of variables

Multivariate data in ecologycode FishSp Sex SL W POLYCH COPEP MOLLU AMPHIP DECAPB1B3D107 barba M 16.1 104.0 10 5 5 5 1

B1B3D108 barba F 13.1 50.0 6 0 0 3 3

B1B3D109 barba M 16.0 86.0 0 0 0 1 1

B1O1D103 barba F 11.5 33.0 0 0 0 3 3

B3O1D302 barba F 15.8 95.0 0 1 0 1 1B3O1D303 barba F 17.8 133.0 0 0 0 2 4B3O1D304 barba F 15.9 90.0 2 0 0 4 4

B3O1D305 barba F 17.1 170.0 17 0 0 14 14

B3O1D306 barba M 18.9 164.0 14 0 0 2 2

B3O1D307 barba M 16.1 86.0 0 0 0 2 2

B3O1D308 barba M 19.3 168.0 0 0 0 11 0B3O1D309 barba M 19.4 159.0 5 0 0 9 9

B3O1D310 barba M 16.6 108.0 0 0 0 7 7

SB013 surm F 12.0 41.0 3 0 0 1 1

SBJ10 surm F 12.5 49.1 0 0 0 2 2

SBJ11 surm F 15.8 101.0 0 6 0 6 6

SBJ13 surm M 15.5 97.0 0 0 0 5 0

SBJ14 surm M 16.0 111.5 0 1 0 1 1SBJ17 surm F 14.5 71.1 5 0 0 2 2

SBJ19 surm M 14.7 83.1 0 0 0 2 2

SBJ20 surm M 14.8 85.8 2 4 0 4 4

SSJ11 surm F 17.8 139.5 0 0 0 2 0

SSJ12 surm F 16.5 108.9 10 0 0 4 4

Categorical

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 6: Data analysis talk_jan2015

…and there are different types of categorical variables …

Multivariate data in ecology

Categorical

Nominal

Ordinal

FishSp Sexbarba Msurm F

Seasonspringsummerfallwinter

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 7: Data analysis talk_jan2015

Other variables are continuous

Multivariate data in ecologycode FishSp Sex SL W POLYCH COPEP MOLLU AMPHIP DECAPB1B3D107 barba M 16.1 104.0 10 5 5 5 1

B1B3D108 barba F 13.1 50.0 6 0 0 3 3

B1B3D109 barba M 16.0 86.0 0 0 0 1 1

B1O1D103 barba F 11.5 33.0 0 0 0 3 3

B3O1D302 barba F 15.8 95.0 0 1 0 1 1B3O1D303 barba F 17.8 133.0 0 0 0 2 4B3O1D304 barba F 15.9 90.0 2 0 0 4 4

B3O1D305 barba F 17.1 170.0 17 0 0 14 14

B3O1D306 barba M 18.9 164.0 14 0 0 2 2

B3O1D307 barba M 16.1 86.0 0 0 0 2 2

B3O1D308 barba M 19.3 168.0 0 0 0 11 0B3O1D309 barba M 19.4 159.0 5 0 0 9 9

B3O1D310 barba M 16.6 108.0 0 0 0 7 7

SB013 surm F 12.0 41.0 3 0 0 1 1

SBJ10 surm F 12.5 49.1 0 0 0 2 2

SBJ11 surm F 15.8 101.0 0 6 0 6 6

SBJ13 surm M 15.5 97.0 0 0 0 5 0

SBJ14 surm M 16.0 111.5 0 1 0 1 1SBJ17 surm F 14.5 71.1 5 0 0 2 2

SBJ19 surm M 14.7 83.1 0 0 0 2 2

SBJ20 surm M 14.8 85.8 2 4 0 4 4

SSJ11 surm F 17.8 139.5 0 0 0 2 0

SSJ12 surm F 16.5 108.9 10 0 0 4 4

Continuous

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 8: Data analysis talk_jan2015

Where would you classify count data?

Multivariate data in ecologycode FishSp Sex SL W POLYCH COPEP MOLLU AMPHIP DECAPB1B3D107 barba M 16.1 104.0 10 5 5 5 1

B1B3D108 barba F 13.1 50.0 6 0 0 3 3

B1B3D109 barba M 16.0 86.0 0 0 0 1 1

B1O1D103 barba F 11.5 33.0 0 0 0 3 3

B3O1D302 barba F 15.8 95.0 0 1 0 1 1B3O1D303 barba F 17.8 133.0 0 0 0 2 4B3O1D304 barba F 15.9 90.0 2 0 0 4 4

B3O1D305 barba F 17.1 170.0 17 0 0 14 14

B3O1D306 barba M 18.9 164.0 14 0 0 2 2

B3O1D307 barba M 16.1 86.0 0 0 0 2 2

B3O1D308 barba M 19.3 168.0 0 0 0 11 0B3O1D309 barba M 19.4 159.0 5 0 0 9 9

B3O1D310 barba M 16.6 108.0 0 0 0 7 7

SB013 surm F 12.0 41.0 3 0 0 1 1

SBJ10 surm F 12.5 49.1 0 0 0 2 2

SBJ11 surm F 15.8 101.0 0 6 0 6 6

SBJ13 surm M 15.5 97.0 0 0 0 5 0

SBJ14 surm M 16.0 111.5 0 1 0 1 1SBJ17 surm F 14.5 71.1 5 0 0 2 2

SBJ19 surm M 14.7 83.1 0 0 0 2 2

SBJ20 surm M 14.8 85.8 2 4 0 4 4

SSJ11 surm F 17.8 139.5 0 0 0 2 0

SSJ12 surm F 16.5 108.9 10 0 0 4 4

Counts

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 9: Data analysis talk_jan2015

Categorical or continuous?

Multivariate data in ecologycode FishSp Sex SL W POLYCH COPEP MOLLU AMPHIP DECAPB1B3D107 barba M 16.1 104.0 10 5 5 5 1

B1B3D108 barba F 13.1 50.0 6 0 0 3 3

B1B3D109 barba M 16.0 86.0 0 0 0 1 1

B1O1D103 barba F 11.5 33.0 0 0 0 3 3

B3O1D302 barba F 15.8 95.0 0 1 0 1 1B3O1D303 barba F 17.8 133.0 0 0 0 2 4B3O1D304 barba F 15.9 90.0 2 0 0 4 4

B3O1D305 barba F 17.1 170.0 17 0 0 14 14

B3O1D306 barba M 18.9 164.0 14 0 0 2 2

B3O1D307 barba M 16.1 86.0 0 0 0 2 2

B3O1D308 barba M 19.3 168.0 0 0 0 11 0B3O1D309 barba M 19.4 159.0 5 0 0 9 9

B3O1D310 barba M 16.6 108.0 0 0 0 7 7

SB013 surm F 12.0 41.0 3 0 0 1 1

SBJ10 surm F 12.5 49.1 0 0 0 2 2

SBJ11 surm F 15.8 101.0 0 6 0 6 6

SBJ13 surm M 15.5 97.0 0 0 0 5 0

SBJ14 surm M 16.0 111.5 0 1 0 1 1SBJ17 surm F 14.5 71.1 5 0 0 2 2

SBJ19 surm M 14.7 83.1 0 0 0 2 2

SBJ20 surm M 14.8 85.8 2 4 0 4 4

SSJ11 surm F 17.8 139.5 0 0 0 2 0

SSJ12 surm F 16.5 108.9 10 0 0 4 4

Counts

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 10: Data analysis talk_jan2015

Functional vs. structural methods

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 11: Data analysis talk_jan2015

Functional approaches: X -> Y

Functional vs. structural methodscode FishSp Sex SL W POLYCH COPEP MOLLU AMPHIP DECAPB1B3D107 barba 0 16.1 104.0 10 5 5 5 1

B1B3D108 barba 1 13.1 50.0 6 0 0 3 3

B1B3D109 barba 0 16.0 86.0 0 0 0 1 1

B1O1D103 barba 1 11.5 33.0 0 0 0 3 3

B3O1D302 barba 0 15.8 95.0 0 1 0 1 1B3O1D303 barba 0 17.8 133.0 0 0 0 2 4B3O1D304 barba 0 15.9 90.0 2 0 0 4 4

B3O1D305 barba 0 17.1 170.0 17 0 0 14 14

B3O1D306 barba 1 18.9 164.0 14 0 0 2 2

B3O1D307 barba 1 16.1 86.0 0 0 0 2 2

B3O1D308 barba 1 19.3 168.0 0 0 0 11 0B3O1D309 barba 1 19.4 159.0 5 0 0 9 9

B3O1D310 barba 1 16.6 108.0 0 0 0 7 7

SB013 surm 0 12.0 41.0 3 0 0 1 1

SBJ10 surm 0 12.5 49.1 0 0 0 2 2

SBJ11 surm 0 15.8 101.0 0 6 0 6 6

SBJ13 surm 1 15.5 97.0 0 0 0 5 0

SBJ14 surm 1 16.0 111.5 0 1 0 1 1SBJ17 surm 0 14.5 71.1 5 0 0 2 2

SBJ19 surm 1 14.7 83.1 0 0 0 2 2

SBJ20 surm 1 14.8 85.8 2 4 0 4 4

SSJ11 surm 0 17.8 139.5 0 0 0 2 0

SSJ12 surm 0 16.5 108.9 10 0 0 4 4

YResponse variable(s)

XPredictor /

Explanatory variable(s)

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 12: Data analysis talk_jan2015

Functional approaches

Functional vs. structural methodscode FishSp Sex SL W POLYCH COPEP MOLLU AMPHIP DECAPB1B3D107 barba 0 16.1 104.0 10 5 5 5 1

B1B3D108 barba 1 13.1 50.0 6 0 0 3 3

B1B3D109 barba 0 16.0 86.0 0 0 0 1 1

B1O1D103 barba 1 11.5 33.0 0 0 0 3 3

B3O1D302 barba 0 15.8 95.0 0 1 0 1 1B3O1D303 barba 0 17.8 133.0 0 0 0 2 4B3O1D304 barba 0 15.9 90.0 2 0 0 4 4

B3O1D305 barba 0 17.1 170.0 17 0 0 14 14

B3O1D306 barba 1 18.9 164.0 14 0 0 2 2

B3O1D307 barba 1 16.1 86.0 0 0 0 2 2

B3O1D308 barba 1 19.3 168.0 0 0 0 11 0B3O1D309 barba 1 19.4 159.0 5 0 0 9 9

B3O1D310 barba 1 16.6 108.0 0 0 0 7 7

SB013 surm 0 12.0 41.0 3 0 0 1 1

SBJ10 surm 0 12.5 49.1 0 0 0 2 2

SBJ11 surm 0 15.8 101.0 0 6 0 6 6

SBJ13 surm 1 15.5 97.0 0 0 0 5 0

SBJ14 surm 1 16.0 111.5 0 1 0 1 1SBJ17 surm 0 14.5 71.1 5 0 0 2 2

SBJ19 surm 1 14.7 83.1 0 0 0 2 2

SBJ20 surm 1 14.8 85.8 2 4 0 4 4

SSJ11 surm 0 17.8 139.5 0 0 0 2 0

SSJ12 surm 0 16.5 108.9 10 0 0 4 4

Find a model / formula relating X with Y

YResponse variable(s)

XPredictor /

Explanatory variable(s)

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 13: Data analysis talk_jan2015

A simple example

X => Dolphin age

Y => Presence/absence of cranial lesions

Related by a semiparametric regression model

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

-0.6

-0.4

-0.2

0.0

0.2

0.4

0.6

Net

rate

of c

hang

e of

lesi

on p

reva

lenc

e (%

)

Dolphin age (yr)Balbuena & Simpkin 2014. Dis Aquat Org 108: 83-89

Parasite induced mortality

Functional vs. structural methods

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 14: Data analysis talk_jan2015

Structural methods

Functional vs. structural methods

YResponse variable(s)

F Latent variable(s)

No explicit link between F and Y (F does not affect the analysis of Y)

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 15: Data analysis talk_jan2015

For example

Functional vs. structural methods

-0.18 -0.12 -0.06 0.00 0.06 0.12Coordinate 1

-0.20

-0.16

-0.12

-0.08

-0.04

0.00

0.04

0.08

Co

ordi

nate

2

NMDS ordination of 2 red mullet spp. based on 5 prey items

F -> fish species &

weight

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 16: Data analysis talk_jan2015

A taxonomy of methods in ecology

Functional vs. structural methods

* or a mixture of continuous and categorical variables

Functional methods

Structural methods

Y consists of

categorical variables

Y consists of

continuous variables*

Ordination

Regression Classification

ClusteringA B C

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 17: Data analysis talk_jan2015

Inference and modelling

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 18: Data analysis talk_jan2015

The inertia of classical statistics

Inference and modelling

A classical problem:A lab claims that an additive added to fish feed increases immune competence (measured as ACH50) of fish

Control Treatment

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 19: Data analysis talk_jan2015

The inertia of classical statistics

Inference and modelling

The differences

between treatment and

control were evaluated

by GLM

Control Treatment

250

300

350

400

450

500

550

[AC

H50

]  Estimate Std.Error t_value Pr(>|t|)(Intercept) 428.92313 103.74581 4.134 0.000471Weight -0.03788 0.12493 -0.303 0.764725Treatment -75.3188 39.86725 -1.889 0.072747

P > 0.05 –> insufficient evidence to conclude that there is an effect of feed on immune response

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 20: Data analysis talk_jan2015

Ecological problems are somewhat different

Inference and modelling

For instance,Factors affecting hatching success of leatherback turtles in the Dominican RepublicRevuelta et al. 2014 Biodivers Conserv 23: 1529–39

Tartaruga-de-couro Dermochelys coriacea

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 21: Data analysis talk_jan2015

Inference and modelling

Hatching

success

Distance to tide

Beach zone

(sand/veg.)

Beach (2 sections)

Year(2007-9)

Julian

Clutch size

N yolkless eggs

Incubation duration

Location

Reproductive

Temporal

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 22: Data analysis talk_jan2015

Inference and modelling

Hatching

success

Distance to tide

Beach zone

(sand/veg.)

Beach (2)

Year(2007-9)

Date

Clutch size

N yolkless eggs

Incubation duration

Location

Reproductive

TemporalWhich of these factors are

significant?

Classical statistics:

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 23: Data analysis talk_jan2015

Inference and modelling

Hatching

success

Distance to tide

Beach zone

(sand/veg.)

Beach (2)

Year(2007-9)

Date

Clutch size

N yolkless eggs

Incubation duration

Location

Reproductive

TemporalHow these factors

contribute to explain hatching success?

Modern approaches:

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 24: Data analysis talk_jan2015

Inference and modelling

Hatching

success

Distance to tide

Beach zone

(sand/veg.)

Beach (2)

Year(2007-9)

Date

Clutch size

N yolkless eggs

Incubation duration

Location

Reproductive

TemporalHow these factors

contribute to predict hatching success?

Modern approaches:

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 25: Data analysis talk_jan2015

P values can be misleading because

Inference and modelling

• They do not convey variable importance

• P is not a measure of effect size

• Collinear variables can lead to high P values

• Multiple comparisons require adjustments of significance levels Jan. 2015

Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 26: Data analysis talk_jan2015

Akaike’s Information Criterion (AIC)

Inference and modelling

• Measures de relative quality of a statistical model

• Allows considering a set of alternative models to explain de data

• Provides ways to evaluate variable importance and effect size

Goodness of fit

No. paramete

rs

AIC = 2k – 2ln(L)

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 27: Data analysis talk_jan2015

Application to the hatching success study

Inference and modelling

Models AIC ΔAIC w

HS ~ SECT + ID + JULIAN + ClutchSZ + YEAR 211.3 0 0.28

HS ~ SECT + ID + JULIAN + ClutchSZ + DIST + YEAR 211.6 0.28 0.24

HS ~ SECT + ID + JULIAN + ClutchSZ + ZONE + YEAR 211.8 0.46 0.23

HS ~ SECT + ID + JULIAN +YEAR 212.9 1.66 0.12

HS ~ SECT + ID + JULIAN + ZONE + YEAR 213.1 1.79 0.12

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 28: Data analysis talk_jan2015

Inference and modelling

Hatching

success

Distance to tide

Beach zone

(sand/veg.)

Beach (2 sectors)

Year(2007-9)

Date

Clutch size

N yolkless eggs

Incubation duration

Variable importance 1

1

1

1

0.75

0.35

0.24

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 29: Data analysis talk_jan2015

Inference and modellingWhat about prediction?

• Model selection serves to explain your data.

• Predictive models require some kind of cross validation

X Y

Training set

Test set

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 30: Data analysis talk_jan2015

Further reading

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 31: Data analysis talk_jan2015

Further reading

Available athttp://www.fbbva.es/TLFU/tlfu/esp/publicaciones/libros/fichalibro/index.jsp?codigo=769

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada

Page 32: Data analysis talk_jan2015

Muito obrigado pela sua atenção!

Institut Cavanilles de Biodiversitat i Biologia Evolutiva

Jan. 2015 Curso de Pós-graduação em Ecologia de Ambientes Aquáticos ContinentaisCurso de Pós-graduação em Biologia Comparada