This discussion is closed.
Christopher War
Badges: 0
#1
Report Thread starter 14 years ago
#1
Hi,

I have to do spearman's rank for my maths coursework at school. I've done the ranking thing and got the number below.


Sum of difference squared = 126.25

I've put this into the formula below and it comes out as almost perfect correlation when I know it should be 0.1. I know this is right because I have put it into Excel. I need to have correct working out to get the marks though.

R^2 = 1 - ((6∑d^2) / (N^3 - n))

R^2 = 1 – ((6 x 126.5) / (900 - 30))

R^2 = 1 – (757.5 / (27000 – 30))

R^2 = 1 – (757.5 / 26969)

R^2 = 1 – 0.028087804

R2 = 0.971912195

R = 0.985856072

I have no idea what I've done wrong here so could somebody please give me a hand. Thanks :confused:
0
manps
Badges: 0
Rep:
?
#2
Report 14 years ago
#2
R = 1 - ((6∑d^2) / (n(n²-1)))

R = 1 – ((6 x 126.25) / (30(30²-1)))

R = 1 – (757.5 / (27000 – 30))

R = 1 – (757.5 / 26970)

R = 1 – 0.028087804

R = 0.971913236

R = 0.971 (3.dp)

hmm cant seem to spot your error
0
Christopher War
Badges: 0
#3
Report Thread starter 14 years ago
#3
(Original post by manps)
R = 1 - ((6∑d^2) / (n(n²-1)))

R = 1 – ((6 x 126.25) / (30(30²-1)))

R = 1 – (757.5 / (27000 – 30))

R = 1 – (757.5 / 26970)

R = 1 – 0.028087804

R = 0.971913236

R = 0.971 (3.dp)

hmm cant seem to spot your error
I guess its something with my ranking then. Thanks for checking out it for me.
0
Jonny W
Badges: 8
Rep:
?
#4
Report 14 years ago
#4
(Original post by Christopher War)
I guess its something with my ranking then. Thanks for checking out it for me.
If (sigma) d^2 = 126.25 then the average difference in ranks, among the 30 items, is about 2 (because 30 * 2^2 is about 126.25). Is that what your data shows?
0
Christopher War
Badges: 0
#5
Report Thread starter 14 years ago
#5
(Original post by Jonny W)
If (sigma) d^2 = 126.25 then the average difference in ranks, among the 30 items, is about 2 (because 30 * 2^2 is about 126.25). Is that what your data shows?
Well, the mean difference is 1.65. :hmmmm:
0
Geogger
Badges: 13
Rep:
?
#6
Report 14 years ago
#6
Are you sure you have ranked both sets of data from biggest to smallest? That's usually the root problem if the maths is OK.
0
Christopher War
Badges: 0
#7
Report Thread starter 14 years ago
#7
(Original post by Geogger)
Are you sure you have ranked both sets of data from biggest to smallest? That's usually the root problem if the maths is OK.
Yep, I ranked them like that. When you get the same thing you take the mean of the rank numbers for the rank of all the numbers that clash, right?
0
Geogger
Badges: 13
Rep:
?
#8
Report 14 years ago
#8
Yes, how many of them clash? If you have lots then you are looking more like grouped data... and Spearman's Rank doesn't like that I'm sure!
0
Geogger
Badges: 13
Rep:
?
#9
Report 14 years ago
#9
R^2 = 1 - ((6∑d^2) / (N^3 - n))

R^2 = 1 – ((6 x 126.5) / (900 - 30))

R^2 = 1 – (757.5 / (27000 – 30)) Surely this should be 900 -30 still!

R^2 = 1 – (757.5 / 26969)

R^2 = 1 – 0.028087804

R2 = 0.971912195

R = 0.985856072
0
Christopher War
Badges: 0
#10
Report Thread starter 14 years ago
#10
(Original post by Geogger)
R^2 = 1 - ((6∑d^2) / (N^3 - n))

R^2 = 1 – ((6 x 126.5) / (900 - 30))

R^2 = 1 – (757.5 / (27000 – 30)) Surely this should be 900 -30 still!

R^2 = 1 – (757.5 / 26969)

R^2 = 1 – 0.028087804

R2 = 0.971912195

R = 0.985856072
You're a genius!

Thanks loads!

0.36

Its not the exact answer, but it will definatly do!
Thanks again
0
Geogger
Badges: 13
Rep:
?
#11
Report 14 years ago
#11
(Original post by Christopher War)
You're a genius!

Thanks loads!

0.36

Its not the exact answer, but it will definatly do!
Thanks again
You're welcome!
0
manps
Badges: 0
Rep:
?
#12
Report 14 years ago
#12
why is this ok if n=30, 30³ is 27000 not 900
0
Christopher War
Badges: 0
#13
Report Thread starter 14 years ago
#13
(Original post by manps)
why is this ok if n=30, 30³ is 27000 not 900
Woa, now I'm confused. :confused: So squaring it actually gives me an answer closer to the true answer!

So what is it that's wrong? I can't find anything.

Maybe I've copied the formula wrong?
0
Geogger
Badges: 13
Rep:
?
#14
Report 14 years ago
#14
mmmmm when you did your differences squared, did you do EACH difference, then square it and THEN add the differences squared

or did you find all the differences, add them, then square the answer?
The correct method is the first.
0
Christopher War
Badges: 0
#15
Report Thread starter 14 years ago
#15
(Original post by Geogger)
mmmmm when you did your differences squared, did you do EACH difference, then square it and THEN add the differences squared

or did you find all the differences, add them, then square the answer?
The correct method is the first.
Nope, it isn't that. Negative differences are eliminated when you square them, right?
0
Jonny W
Badges: 8
Rep:
?
#16
Report 14 years ago
#16
(Original post by Christopher War)
Well, the mean difference is 1.65. :hmmmm:
So the rankings are very similar. Why do you then expect a small value of R?
0
Geogger
Badges: 13
Rep:
?
#17
Report 14 years ago
#17
How about posting an excel attachment so we can see the figures?
Have you tried a simple scattergraph to see what it should look like?
0
Christopher War
Badges: 0
#18
Report Thread starter 14 years ago
#18
(Original post by Jonny W)
So the rankings are very similar. Why do you then expect a small value of R?
I think I know what I've done.

I've ranked both variables in order from highest to lowest. Thats okay, but in my table, I've put them in that order as well so that the highest of each variable is with the highest of the the other. No wonder they have near-perfect correlation! :eek:

Sorry, that was really stupid of me. Thanks for your help everybody though.

Sorry
0
X
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

University open days

  • The University of Law
    The Bar Series: Applications and Interviews - London Bloomsbury campus Postgraduate
    Thu, 17 Oct '19
  • Cardiff Metropolitan University
    Undergraduate Open Day - Llandaff Campus Undergraduate
    Sat, 19 Oct '19
  • Coventry University
    Undergraduate Open Day Undergraduate
    Sat, 19 Oct '19

How has the start of this academic year been for you?

Loving it - gonna be a great year (141)
17.87%
It's just nice to be back! (213)
27%
Not great so far... (283)
35.87%
I want to drop out! (152)
19.26%

Watched Threads

View All