Introduction to Spatial Statistics Advanced Biostatistics Dean C. Adams Lecture 13

advertisement

Introduction to Spatial Statistics

Advanced Biostatistics

Dean C. Adams

Lecture 13

EEOB 590C

1

Geography in Biological Data

•Biological organisms inhabit physical space

•Several interesting questions relate to geography/space

1: How are my observations distributed?

2: Are my data associated with geography?

3: Are my data spatially autocorrelated?

4: Can I account for spatial autocorrelation in my analysis?

2

1: Point Patterns

• The distribution of objects in space can be of interest

• Possible distributions: the locations are random, they are more clumped than expected, they are more regular (dispersed) than expected

Random

Clumped Regular

(Dispersed)

8

6

4

2

0

0

12

10

16

14

5 10 15

Other options exist

Clumps of

Regular

Regular

Clumps

• How does one statistically assess these distributions?

Area Partition Methods and Distance Methods

3

Point Patterns: Aggregation Index

• Are points random, clumped, or regular?

16

14

12

10

8

6

4

2

0

0 5 10 15

• 1 st order nearest neighbor index (index of aggregation: R)

• Calculate nearest neighbor distances (NND)

Determine average NND: r

Obs

• Determine ratio of observed vs. expected*:

R < 1: clumped

R = 1: random

• R > 1: regular (dispersed)

Test for significance (convert to Z-score)

R

 r

Obs r

Exp

*see Clark and Evans (1954: Ecology ) for description of obtaining expected values

4

Point Patterns: Ripley’s K

• Models the point pattern relative to some process

K

( ) l

E(pts) = expected # points in some area; l

= density of points

K describes # points in area relative to expectation

• Use

K to test hypotheses of clustering or regular dispersion

Assessed statistically via stochastic simulations

K obs

K theo

K hi r

K lo r r r

E

0.00

0.05

0.10

r

0.15

0.20

0.25

5

Point Patterns: Area Partition Methods

• Quadrat Method:

• Break into quadrats and count objects (X) in each of the n quadrats

Calculate Index of Dispersion (variance – mean ratio):

ID

X

2

X

ID*(n-1) follows a X 2 with ( n -1) df

ID Can estimate whether points differ from a random dispersion, but not HOW they differ (i.e., clumped vs. regular)

6

Point Patterns: Area Partition Methods

• Contiguous Quadrat Method

• Break area into successively smaller quadrats nested one within the other, such that each quadrat is half the size of its ‘parent’

• Count objects in each quadrat

For each quadrat size (r) calculate: , where Tr is the sum r

2 T r

T

2 r of squares for the r th quadrat size

Test each quadrat size using ratio:

G r

(Compare to F with N/2r and N/2 df)

G

1

Random points: constant Gr with r; Clumped points: Gr peaks at the clump size (r); Regular points: Gr decreases and bottoms out at regular grain size (r)

Note: There are many other dispersion indices (see Dale, 1999; Rosenberg, 2003) 7

Point Patterns: Distance Methods

• Use distances among objects to determine whether they are farther apart, or closer together than expected by chance (randomness)

Plant-Plant Distance (W): Calculate distance between objects and their

1st, 2nd, 3rd (etc.) nearest neighbors

Point-Plant Distance (X): Calculate distance between randomly chosen locations and their 1st, 2nd, 3rd (etc.) nearest neighbor objects

• Point-Plant-Plant Distance (Y): choose random location, find the nearest object to it, and calculate the distance from that object to its 1st,

2nd, 3rd (etc.) nearest neighbors

• Determining whether the distribution of objects is different from Poisson random is basically asking the probability that another object is within an area radius W (or X, Y)

MANY different tests for randomness have been proposed based on these measurements

• One can also compare observed data to randomly generated point patterns

8

2: Space as Biological Factor

•If geographic localities of objects are known, one can obtain a geographic distance matrix

•Several hypotheses can now be addressed

•Is some variable (Y) associated with geography?

•Are 2 variables (X and Y) associated while accounting for geographic patterns? morphology associated with resource use?

•Mantel tests are one way to assess these hypotheses

9

Human Genetic Example

•Sokal (1988) examined European genetic and linguistic data

•27 genetic distance matrices (each data type separately)

•Geographic distance

•Linguistic ‘design’ matrix (0= same language family, 1=same language phylum but different family, 2= different language phylum)

870 European localities

From Sokal (1988). Proc. Natl. Acad. Sci., USA. 85:1722-1726.

10

Human Genetic Example: Results

•Genetic groups and Language groups are associated with geography

•Genetic groups and language groups are associated even when geography is taken into account

From Sokal (1988). Proc. Natl. Acad. Sci., USA. 85:1722-1726.

11

Cyprinid Fishes

•What historical patterns that shaped current phenotypic diversity

•Test hypotheses of local adaptation, gene flow & vicariance

•Data: phenotypic variation at 33 sites, historical drainage patterns, habitat types: all converted to distance matrices

From Douglas et al. 1999. Evolution. 53:238-246.

12

Cyprinid Fishes: Results

•Pliocene drainages most highly associated with current phenotypic diversity

From Douglas et al. 1999. Evolution. 53:238-246.

13

3: Spatial Autocorrelation

• Spatial Autocorrelation : lack of independence of values based on spatial properties

•self-correlation: close values are more similar/different

•Test whether observed values at one locality depend (at least in part) on those at neighboring localities

•Procedure:

•Obtain data for each locality (Y)

(can be continuous or categorical)

•Determine which localities are ‘neighbors’ (or distance classes)

•Neighbors represented in a CONNECTIVITY MATRIX (or weight matrix)

•Estimate spatial autocorrelation for neighbors/distance class

14

Connectivity (W): Neighbors & Distances

• Regularly-spaced data: W from ‘chessboard’ methods:

• Irregularly-spaced data: Spatially-defined neighbors

(many methods)

Delauney tesselation/ theisson polygons

• Gabriel network

Relative neighborhood

• Divide distances into distance-classes: equal interval or equal frequency

15

Spatial Autocorrelation: Join-Counts

• For categorical data (A,B)

Join-Count statistic: sums the number of connections of a given type: r

AA

1

2

 ij w AA ij

( ) ij

Convert to Z-score and assess vs. normal distribution w ij is the weight (0 = not connected, 1 = connected), (AA) ij is A-A connection

(divide by ½ because upper and lower diagonal

W are identical)

Note: negative or positive depends on how you make the connections (e.g., bishop vs. rook yield complementary -/+ values) r

BB

0 r

BW

12

• z-scores are: BB = -3.4156 WW = -2.245 BW = 3.456

• conclusion: significant negative spatial autocorrelation

16

Spatial Autocorrelation: Moran’s I Geary’s c

• For continuous data, statistic is S

(weights * data)

• Moran’s I : range –1 (negative) to +1 (positive) autocorrelation

I

 n n n  i

1 j

1 w

W ij i n 

1

 y i y

 i y

 y

2 y j

 y

 w ij is the weight, y i y is data distance class, W =

S

( w ij

)

• Geary’s c: range 0 to positive values

(0 is positive autocorrelation, + values are negative)

 n

1

 i n n 

1 j

1 w ij

 y i

 y j

2 c

2 W i n 

1

 y i

 y

2

• Significance based on normal approximation

(see Legendre and Legendre for details) z

I

I ( ) obs

I

  n

1

1

I and c found for each distance class

( )

1

Note: Semivariograms based on unstandardized Geary’s c

(Geary’s c = semivariogram standardized by variance).

17

Spatial Correlogram: Example

• Sokal and Thompson (1987) examined distribution and attributes of understory plant, Aralia nudicaulis, (fecundity, density, canopy cover, percent female)

Significant spatial autocorrelation for most variables (except fecundity), none of which showed the same pattern (i.e. variables exhibited autocorrelation, but not spatial association)

AN=Aralia density

CA=canopy cover

F=fecundity

PF=percent female

18

Spatial Correlogram: Multivarate Data

• For multivariate data, use Mantel Test Correlogram

- Calculate distances for Y

Perform Mantel test on distance class and plot

Mantel correlogram of D genetic genetic spatial autocorrelation showing

Data from Highton (1989).

19

Measuring Spatial Autocorrelation

Moran’s I is generally plotted as a discrete stepwise trend over geographic distance (bins)

Important point! In answering if data are spatially autocorrelated, one must have a model to consider. Autocorrelation is a measure of the coordinated residual size and direction of observations found at a certain geographic distance between subjects. Most models won’t be bad at large distances.

Moran’s I allows one to ask if spatial autocorrelation is perhaps intruding at small or intermediate distances.

Dormann et al. (2007) Ecography.

20

4: Accounting for Spatial Non-Independence

•Incorporate spatial non-independence in hypothesis testing

•In GLS, this is modeled in the error

•Standard GLM: ε   2

~

0,

 2

Y = Xβ + ε

•Spatial GLS:

Solve by:

Structured error term (

S

) = spatial covariance matrix

 

-1

β = X Σ X X Σ Y

Σ = observed correlations/distance among objects, or expected correlations based on some spatial model 21

Modeling Spatial Non-Independence

• S describes covariance among locations, with coefficients proportional to distance

(or expected decay similarity as function of distance)

•MANY models proposed to describe spatial non-independence

Exponential

= s

2 e

r / d

Spherical

= s

2 ç

æ

è

Guassian

=

1

-

2 / p ç

æ

è r / s d

2 e

1

( r / d

)

r

2

2 d

2

+ sin

-

1 r d

÷

ö

ø

÷

ö

ø

See: Dormann et al. (2007) Ecography.

22

Spatial Dependence: Autoregressive Models

Adjust predicted values based on adjusting observed values, by the autoregressive scalar times the spatial weights between subjects – little effect if subjects are far apart in geographic space. W can be estimated in various ways.

Recall, W is an n x n matrix

Autoregressive models, ρ = autoregression parameter

See: Dormann et al. (2007) Ecography.

23

Spatial Dependence: Autoregressive Models

Adjust predicted values based on adjusting observed values and an error edition (because maybe both the explanatory and response variables are auto correlated).

Recall, W is an n x n matrix

See: Dormann et al. (2007) Ecography.

24

Some Models

GLM = General Linear Model

GAM = trend-surface General Additive Model (no autocorrelation models – just adds geographic trends to the general linear model) autocov = Autocovariate model –

GLMM = GLS with mixed effects model (allows for spatial autocorrelation within groups)

CAR = Conditional Autoregressive models

SAR = Sequential Autoregressive models

GEE = Generalized Estimating Equations (like GLM, but allows for different spatial weighting for “clusters” of subjects) geese = GEE but with greater constraint on spatial correlations based on certain distances

SEVM = PCoA on Gower centered distance matrix, followed by adding eigenvectors as variables to GLM until Moran’s I is no longer significant

In all cases, GLS performed about the best!

See: Dormann et al. (2007) Ecography.

25

Summary

Spatial context hugely important to consider in biology

1: How are my observations distributed?

Point Pattern Analysis

2: Are my data associated with geography?

Mantel tests

3: Are my data spatially autocorrelated?

Moran’s I

4: Can I account for spatial autocorrelation in my analysis?

GLS is general and very useful model

26

Download