Presentation is loading. Please wait.

Presentation is loading. Please wait.

Correlation – Spearman’s. What does it do? Measures rank correlation – whether highest value in the 1 st data set corresponds to highest in the 2 nd set.

Similar presentations


Presentation on theme: "Correlation – Spearman’s. What does it do? Measures rank correlation – whether highest value in the 1 st data set corresponds to highest in the 2 nd set."— Presentation transcript:

1 Correlation – Spearman’s

2 What does it do? Measures rank correlation – whether highest value in the 1 st data set corresponds to highest in the 2 nd set etc. eg Do higher nitrogen levels give greater plant growth? Takes values between –1 and 1 Note: the data do not have to be in a perfect straight line to have perfect rank correlation – just in the same order Perfect negative rank correlation +1 0 No correlation Perfect positive rank correlation

3 Planning to use it? You have at least 5 data pairs (more is better) You want to use rank correlation rather than straight line correlation – if your data are close to a straight line, Pearson’s may be better You do not have too many ties Make sure that…

4 How does it work? You assume (null hypothesis) there is no correlation The test involves ranking the data (rank 1 for highest value, rank 2 for 2 nd highest etc) and looking at the differences between ranks.  If the two sets of ranks tend to agree (eg the highest nitrate levels being associated with the greatest plant growth) – it’s positive correlation  If the two sets of ranks tend to disagree (eg the smallest soil salinity levels being associated with the greatest plant growth) – it’s negative correlation

5 Doing the test These are the stages in doing the test: 1.Write down your hypotheseshypotheses 2.Work out the ranksranks 3.Do the calculations to get a value for the correlationcalculations 4.Look at the tablestables 5.Make a decisiondecision Click here Click here for an example

6 Hypotheses H 0   = 0 (there is no correlation) For H 1, you have a choice, depending on what alternative you were looking for. H 1:  > 0 (positive correlation) orH 1:  < 0 (negative correlation) orH 0:   0 (some correlation) If you have a good scientific reason for expecting a particular kind of correlation, use one of the first two. If not, use the   0

7 You’ll have two sets of data Eg nitrate concentrations and mean seedling height You rank each set of data separately, giving 1 to the largest value, 2 to the 2 nd largest, 3 to the 3 rd largest etc Eg you’d rank all the concentration data, giving rank 1 to the largest. Then you’d rank all the mean seedling heights, giving rank 1 to the largest. If you have any ties, you give them the average of the ranks they would have had otherwise Eg if two concentrations tied for 3 rd place, they would otherwise have used up ranks 3 and 4. So you give them the average of 3 and 4 =3.5 Ranks

8 Calculations Work out the difference between the ranks for each point. These are called d-values Eg – the difference in the rank for nitrate concentration and for mean seedling height. Square all your d-values and add up the answers. This gives you  d 2 Substitute into the formula n is the number of samples

9 Tables This is a Spearman’s correlation coefficient table This is the number of pairs These are your significance levels eg 0.05 = 5% Note different 1 and 2-tail values

10 Make a decision If your value is bigger than the tables value (ignoring signs), then you can reject the null hypothesis. Otherwise you must accept it. Make sure you choose the right tables value – it depends whether your test is 1 or 2 tailed:  If you are using H 1 :  > 0 or H 1 :  < 0, you are doing a 1-tailed test  If you are using H 1 :   0, you are doing a 2-tailed test

11 Example: Soil Salinity & Plant Height The data below were collected on soil salinity and plant height. Hypotheses: H 0:  = 0 (no correlation) H 1   0 (some correlation)

12 Ranks Soil salinity2812151625 Plant height104040527548 Rank (salinity)143265 Rank (height)64.54.5213 These tied for 4 th place. They are both given the rank 4.5 (the average of 4 and 5) Since the previous two “used up” the ranks of 4 and 5, this has rank 6

13 Calculations Soil salinity2812151625 Plant height104040527548 Rank (salinity)143265 Rank (height)64.54.5213 d-5-0.5-1.5052 d 2 250.252.250254 So  d 2 = 25 + 0.25 + 2.25 + 0 + 25 + 4 = 56.5

14 Test We have used H 1   0 – so it is a 2-tailed test Tables value (5% level): 0.8286 So we must accept H 0 – there is no significant correlation  = - 0.6142


Download ppt "Correlation – Spearman’s. What does it do? Measures rank correlation – whether highest value in the 1 st data set corresponds to highest in the 2 nd set."

Similar presentations


Ads by Google