# Which Statistical Test to use?

I aim to determine whether there is a correlation between terrain variables (elevation, aspect and slope) and structural information acquired in forest survey. I have used ArcMap's extract multi values to points to determine the terrain variable values for each tree species, but am unsure of which statistical test to apply to the datasets to determine whether there is correlation or not?

It is really quite straightforward to obtain a Pearson's correlation coefficient. Given a population assumption:

xBar = mean(x)

yBar = mean(y)

xyBar = mean( (x * y) )

covariance = xyBar - xBar * yBar

correlation = covariance / ( sd(x) * sd(y) )

Unless your points represent a true sample (e.g., field data), there is no need to subsample. This equation easily be applied to two rasters to obtain either, a moving window "local measure of correlation" or a single global correlation coefficient using the global statistics of each raster listed under raster properties. For a global correlation you would need to produce a raster representing x*y so you can obtain the mean of xyBar.

If your data represents a sample then it is no longer a population measure and you will need to modify the equation to be technically correct. Although, the population measure will give you a general idea of the linear relationship(s). For a sample correlation (r) you can substitute the variance and covariance based on a sample:

[ sum( (x - mean(x)) (y - mean(y)) ] / [ sqrt(sum(x - mean(x)^2)) sqrt(sum(y - mean(y)^2)) ]

Given your question, please keep in mind that aspect is a circular variable and a correlation based on it will be meaningless. You will need to transform it in some way.

Pearson Correlation Coefficient in R

go to file / change dir... and navigate to the folder with your csv

``````data = read.csv("yourdata.csv")
cor(data)
pairs(data)
?cor
?pairs
``````

http://en.wikipedia.org/wiki/Pearson_product-moment_correlation_coefficient

Spatial analysis in ArcMap

Polygon data:

ArcMap's Geographically Weighted Regression is good for multivariate datasets. http://resources.arcgis.com/en/help/main/10.1/index.html#//005p00000021000000

GeoDa (free software) has a Bivariate LISA (local indicators of spatial autocorrelation) tool that will allow you to compare 2 variables. https://geodacenter.asu.edu/node/377

Point data:

For point data, take a look at Ordinary Least Squares in ArcMap. http://resources.arcgis.com/en/help/main/10.1/index.html#//005p00000022000000