Correlation Hal Whitehead BIOL4062/5062. The correlation coefficient Tests Non-parametric...

of 53 /53
Correlation Hal Whitehead BIOL4062/5062

Embed Size (px)

Transcript of Correlation Hal Whitehead BIOL4062/5062. The correlation coefficient Tests Non-parametric...

  • CorrelationHal WhiteheadBIOL4062/5062

  • The correlation coefficientTestsNon-parametric correlationsPartial correlationMultiple correlationAutocorrelationMany correlation coefficients

  • The correlation coefficient

  • Linked observations: x1,x2,...,xn y1,y2,...,yn Mean: x = xi / n y = yi / n Variance: S(x)= (xi-x)/(n-1) S(y)= (yi-y)/(n-1) Standard Deviation: S(x) S(y) Covariance: S(x,y) = (xi-x) (yi-y) / (n-1)

  • Covariance: S(x,y) = (xi-x) (yi-y) / (n-1)

    Correlation coefficient(Pearson or product-moment):

    r = {(xi-x) (yi-y) / (n-1) } / {S(x) S(y)}

    r = S(x,y) / {S(x) S(y)}

  • The correlation coefficient:

    r = S(x,y) / {S(x) S(y)}

    -1 r +1

    If no linear relationship: r = 0

    r2: proportion of variance accounted for by linear regression

  • r = -0.01

  • r = 0.38

  • r = -0.31

  • r = 0.95

  • r = 0.04

  • r = 0.64

  • r = -0.46

  • r = 0.99

  • r = -0.0

  • Tests on Correlation Coefficients

  • Tests on Correlation CoefficientsAssume:IndependenceBivariate Normality

  • Tests on Correlation CoefficientsAssume:IndependenceBivariate Normality

  • Tests on Correlation CoefficientsAssume:IndependenceBivariate NormalityThen:z = Ln [(1+r)/(1-r)]/2 is normally distributed with variance 1/(n-3)And, if (true population value of r) = 0 : r (n-2) / (1-r) is distributed as Student's t with n-2 degrees of freedom

  • We can test:a) r 0b) r > 0 or r < 0c) r = constantd) r(x,y) = r(z,w)

    Also confidence intervals for r

  • Are Whales Battering Rams?(Carrier et al. J. Exp. Biol. 2002)

  • Are Whales Battering Rams?(Carrier et al. J. Exp. Biol. 2002)r = 0.75(SE = 0.15)(95% C.I. 0.47-0.89)

    Tests:r 0 : P = 0.0001r > 0 : P = 0.00005

    More sexually dimorphic specieshave relatively larger melons

  • Why do Large Animals have Large Brains?(Schoenemann Brain Behav. Evol. 2004)Correlations among mammalsLog brain size withLog muscle massr=0.984Log fat mass r=0.942Are these significantly different?t=5.50; df=36; P
  • Non-Parametric Correlation

  • Non-Parametric CorrelationIf one variable normally distributedcan test r=0 as before.If neither normally distributed:Spearman's rS rank correlation coefficient(replace values by ranks)or:Kendall's correlation coefficientUse Spearman's when there is less certainty about the close rankings

  • Are Whales Battering Rams?(Carrier et al. J. Exp. Biol. 2002)r = 0.75rS = 0.62= 0.47

  • Partial Correlation

  • Partial CorrelationCorrelation between X and Y controlling for Zr (X,Y|Z) = {r(X,Y) - r(X,Z)r(Y,Z)} {(1 - r(X,Z))(1 - r(Y,Z))}

    Correlation between X and Y controlling for W,Zr (X,Y|W,Z) = {r(X,Y|W) - r(X,Z|W)r(Y,Z|W)} {(1 - r(X,Z|W))(1 - r(Y,Z|W))}

    n-2-c degrees of freedom(c is number of control variables)

  • Why do Large Animals have Large Brains?(Schoenemann Brain Behav. Evol. 2004)Correlations among mammalsLog brain size withLog muscle massControlling for Log body massr=0.466Log fat massControlling for Log body mass r=-0.299Fatter species have relatively smaller brains and more muscular species relatively larger brains

  • Semi-partial Correlation Coefficient

    Correlation between X & Y controlling Y for Z

    r (X,(Y|Z)) = {r(X,Y) - r(X,Z)r(Y,Z)} (1 - r(Y,Z))

  • Are Whales Battering Rams?(Carrier et al. J. Exp. Biol. 2002)Correlationr = 0.75

    Partial Correlationr (SSD,MA|L) = 0.73

    Semi-partial Correlationsr (SSD,(MA|L)) = 0.69r ((SSD |L),MA) = 0.71

  • Multiple Correlation

  • Multiple Correlation CoefficientCorrelation between one dependent variable and its best estimate from a regression on several independent variables:r(YX1,X2,X3,...)

    Square of multiple correlation coefficient is:proportion of variance accounted for by multiple regression

  • Multiple Partial Correlation Coefficient!

  • Autocorrelation

  • AutocorrelationPurposesExamine time seriesLook at (serial) independence

  • Data(e.g. Feeding rate on consecutive days, plankton biomass at each station on a transect):1.5 1.7 4.3 5.4 5.7 6.2 3.9 4.4 5.2 4.8 3.9 3.7 3.6

    Autocorrelation of lag=1 is correlation between:1.5 1.7 4.3 5.4 5.7 6.2 3.9 4.4 5.2 4.8 3.9 3.7 1.7 4.3 5.4 5.7 6.2 3.9 4.4 5.2 4.8 3.9 3.7 3.6 r = 0.508

    Autocorrelation of lag=2 is correlation between:1.5 1.7 4.3 5.4 5.7 6.2 3.9 4.4 5.2 4.8 3.9 4.3 5.4 5.7 6.2 3.9 4.4 5.2 4.8 3.9 3.7 3.6 r = -0.053.

  • Autocorrelation Plot (Correlogram)

  • Many Correlation Coefficients

  • Many Correlation Coefficients:[Behaviour of Sperm Whale Groups]

    NGR25LSSTSHITRLSPEEDAPROPSOCVSHR2LFMECSLAERRNGR25L1.00SST0.121.00SHITR-0.21-0.33*1.00LSPEED0.10-0.28+0.061.00APROP-0.15-0.34*0.070.181.00SOCV-0.050.08-0.16-0.01-0.33*1.00SHR2-0.18-0.120.01-0.200.19-0.031.00LFMECS0.080.14-0.13-0.12-0.220.29+-0.181.00LAERR-0.100.03-0.21-0.24-0.020.24-0.080.231.00Listwise deletion, n=40; P

  • Many Correlation Coefficients:[Behaviour of Sperm Whale Groups]

    NGR25LSSTSHITRLSPEEDAPROPSOCVSHR2LFMECSLAERRNGR25L1.00SST0.121.00SHITR-0.21-0.331.00LSPEED0.10-0.280.061.00APROP-0.15-0.340.070.181.00SOCV-0.050.08-0.16-0.01-0.331.00SHR2-0.18-0.120.01-0.200.19-0.031.00LFMECS0.080.14-0.13-0.12-0.220.29-0.181.00LAERR-0.100.03-0.21-0.24-0.020.24-0.080.231.00Listwise deletion, n=40; P

  • Many Correlation Coefficients:[Behaviour of Sperm Whale Groups]

    NGR25LSSTSHITRLSPEEDAPROPSOCVSHR2LFMECSLAERRNGR25L1.00SST0.121.00SHITR-0.21-0.33*1.00LSPEED0.10-0.28+0.061.00APROP-0.15-0.34*0.070.181.00SOCV-0.050.08-0.16-0.01-0.33*1.00SHR2-0.18-0.120.01-0.200.19-0.031.00LFMECS0.080.14-0.13-0.12-0.220.29+-0.181.00LAERR-0.100.03-0.21-0.24-0.020.24-0.080.231.00Listwise deletion, n=40; P

  • Many Correlation CoefficientsMissing values:Listwise deletion (comparability), orPairwise deletion (power)P-values:Uncorrected: type 1 errorsBonferroni, etc.: type 2 errors

  • Beware!Correlation Causation Y1 Y2Y1 Y3 Y4Y2 Y5Y1 Y3Y2 Y2Y1 Y3 Y4Y1 Y3 Y4Y2 Y5Y1 Y3 Y4 Y5Y2 Y6