Skip to main content

Exercise 1

The aim of this exercise is to provide you with practice using a Spearman rank correlation (6.1) and confirm that our assertion in BOX 6.5 about the data in Example 6.3 is correct.

Example 6.3. The lower arm (cm) and lower leg (cm) length of a small cohort of female undergraduates

In an investigation into human morphology the lower arm and lower leg length of 12 female undergraduates was recorded (Table 6.6) on one particular day.

Table 6.6: Lower arm (cm) and lower leg (cm) length in a small cohort of female undergraduates

Student

Lower arm length (cm)

Lower leg length (cm)

Student

Lower arm length (cm)

Lower leg length (cm)

1

24

39

7

26

41

2

25

40

8

25.5

40

3

23

36

9

24.2

36.7

4

26

43

10

25

38

5

24

38

11

24

41

6

23

35

12

24.5

40



1

Q W1.1

In 6.6 (Example 6.3) we used a principal axis regression to calculate the formula of the regression line for this data (y = - 26.94319 + 2.68871x ). One of the criterion for using the principal axis regression is that 'you have confirmed, using a correlation analysis, that the association is significant'.

In this table, we have included a number of values that are used in the Spearman rank correlation. Place a cross (x) beside those which are incorrect. In the calculation let the measurements of arm length (cm) be variable 1 (x) and the measurements of leg length (cm) be variable 2 (y) (BOX 6.1, Fig 6.14).

Have you completed your table?

a) Yes
b) No

Are these values correct?

Our answer, with brief notes

The rank for the lower arm value of 24 cm is 3.

x (The answer is 4, check your ranking).

The rank for the lower leg value of 41 is 10.5.

 

Σd2 = 16.0

x (This is the sum of d, squared)

Σd2 = - 4.0

x (This is the sum of d)

Σd2 = 78.50

 

n = 12

 

n = 24

x

rscritical at p = 0.05, n = 12 is 0.591

Yes, since n = 12 and this is a two tailed test.

Therefore, we do not reject the null hypothesis.

x



Complete the table before proceeding!
Check your answer

The full calculation of Q W1.1 is as follows:

1. Hypotheses to be tested

H0: There is no correlation between the lengths of lower arms (cm) and lower legs (cm) in a number of female students

H1: There is a correlation between the lengths of lower arms (cm) and lower legs (cm) in a number of female students.

2. How to work out rscalculated

i. Let the measurements of arm length (cm) be variable 1 (x) and the measurements of leg length (cm) be variable 2 (y) (Fig 6.14.).

ii, iii, iv, v.

If you are working this calculation out 'by hand' it is simplest to use a calculation table. The outcome from steps ii, iii, iv, v and vi are shown in Table W6.1 using the data from Example 6.3.

Table W6.1: Calculating a Spearman rank correlation between the lengths (cm) of the lower arm and lower leg in a group of female undergraduates

Lower arm length (cm)

Rank

Lower leg length (cm)

Rank

Difference (d)

Difference2 (d2)

24

4

39

6

-2.0

4.00

25

8.5

40

8

0.5

0.25

23

1.5

36

2

-0.5

0.25

26

11.5

43

12

-0.5

0.25

24

4

38

4.5

-0.5

0.25

23

1.5

35

1

0.5

0.25

26

11.5

41

10.5

1.0

1.00

25.5

10

40

8

2.0

4.00

24.2

6

36.7

3

3.0

9.00

25

8.5

38

4.5

4.0

16.00

24

4

41

10.5

-6.5

42.25

24.5

7

40

8

-1.0

1.00

n = 12

       

Σd2 = 78.50



vi & vii. The difference between the ranks and sum of ranks has been added to the calculation table (Table W6.1).

viii. In this example n = 12 pairs of observations. So

rs = 1 - r(s) calculation

= 1 - r(s) calculation = 1 - r(s) calculation = 1 - r(s) calculation

= 1 - 0.27448

= 0.72552

3. How to find rs critical

rscritical at p = 0.05, n = 12 is 0.591

4. The rule

In our example rs was positive so the fact that we take the absolute value will not change rs in this example. rscalculated (0.725) is greater than rscritical (0.591) at p = 0.05.

5. What does this mean in real terms?

There is a significant positive correlation (rscalculated = 0.725, p = 0.05) between the lengths of lower arms (cm) and lower legs (cm) in a number of female students.

We have also shown how to calculate this using the following software packages:

Excel

SPSS

Minitab

How to calculate Q W1.1 in Excel

There is no direct way of performing the Spearman Rank Correlation analysis in Excel.

How to calculate Q W1.1 in SPSS

Step 1: Set up the variables

When SPSS starts up, select 'variable view' using the tabs at bottom-left. You should get something like this:

SPSS: Step 1 (i)

For the first variable name, type in 'arm' (variable names in SPSS have to be eight characters or less), and for the second 'leg'. Default properties are set for each variable.

SPSS: Step 1 (ii)

Change the 'decimals' property of both variables to '1' by clicking in the 'decimals' cell, and using the 'up-and-down' arrows that appear at the right-hand side of the cell.

SPSS: Step 1 (iii)

Transfer to data view using the tabs at bottom-left, and enter the data.

SPSS: Step 1 (iv)

Step 2: Perform the test.

Go to 'Analyze', 'Correlate', 'Bivariate'.

SPSS: Step 2 (i)

Click on 'arm' to highlight it, then click on the arrow to transfer it across to the 'variables' box. Repeat for 'leg'. Make sure that 'Spearman' is selected.

SPSS: Step 2 (ii)

Click on 'OK'. The results will appear in a new window.

Nonparametric Correlations

SPSS: correlations results

Note: The reason that this gives a slightly different value from the longhand version is that the longhand version uses an approximation that only works exactly if there are no ties in the rankings. In this data set, we have several ties in the rankings.

Step 3: Decide what the results mean.

SPSS computes a complete correlation matrix, so it includes rather meaningless things like the correlation of arm length with itself, and performs the correlations both ways (arm length correlated with leg length, and leg length correlated with arm length) which is a bit of a waste of effort for a Spearman test.

The important numbers here are the correlation coefficient of 0.719 for arm length and leg length (or leg length and arm length), which is large and positive (as leg length increases, so arm length increases); and the 'Sig. (2-tailed)', which is 0.008: this is the p-value, and gives the probability that there is no correlation between the test variables. We therefore conclude that there is a positive correlation between leg length and arm at a significance of better than p = 0.01.

How to calculate Q W1.1 in Minitab

There is no direct way of performing the Spearman Rank Correlation analysis in Minitab.