How to Compute the Spearman Rank Correlation Coefficient

Spearman's Rank Correlation Coefficient is a number between -1 and +1 that represents the strength of the relationship between two variables in a set of data. A coefficient of -1 indicates there is a perfect inverse relationship between the data. A coefficient of +1 indicates there is a perfect positive relationship between the data. To calculate the coefficient, you need a set of data with two variables for which you want to test the relationship. For example, you might use a data set of 9 observations of "education level -- average income" for males in 2006:

1 - 22,710; 2 - 27,650; 3 - 37,030; 4 - 43,830; 5 - 47,070; 6 - 60,910; 7 - 75,430; 8 - 100,000; 9 - 100,000 where 1 = 9th grade, 2 = 9th to 12th, no graduation; 3 = High school; 4 = College, no degree; 5 = Associate's, 6 = Bachelor's, 7 = Master's, 8 = Professional degree, 9 = Ph.D.

Instructions

    • 1

      Organize the data in pairs in a table so each row has an observation number, independent variable -- income -- and dependent variable -- education. Plot the independent variable on the y-axis and the dependent variable on the x-axis. Visually inspect the graph to see if a relationship exists and you want to proceed with calculating Spearman's Rank Correlation Coefficient.

    • 2

      Add a column in the data table next to the independent variable called "Independent Rank" and a column next to the dependent variable called "Dependent Rank." Rank the independent variable observations from high to low, giving a rank of "1" to the highest observation. Assign the average rank to two or more observations with the same value. For example, the highest independent variable is 100,000 and it appears twice at ranks 1 and 2. Calculate the average (1 + 2 = 3/2 = 1.5) and assign that to both observations. Complete the same process for the dependent variable. For example, education level "9" is rank "1," "8" is rank "2" and so on.

    • 3

      Add two more columns to the table labeled "d" and "d^2". Subtract the independent rank variable from the dependent rank variable and put that value in column "d." Square the value in column "d" and put that in column "d^2." Sum all the values in the "d^2" column to get a total; for example, the total is 7.5 in the education/income data set.

    • 4

      Use the Spearman Rank formula to calculate the coefficient. The formula is:

      (R) = 1 - (6 * sum(d^2))/(n^3 - n)

      where "R" is the coefficient, "sum(d^2)" is the total of the "d^2" column and "n" is the number of observations. For example:

      R = 1 - (6 * 7.5)/(9^3 - 9)

      R = 1 - (45) / (729 - 9)

      R = 1 - 0.0625

      R = 0.935

    • 5

      Calculate the "degrees of freedom" by subtracting 2 from the number of observations; for example, 9 - 2 = 7. Look up the coefficient and degrees of freedom in the Spearman Rank significance table to interpret the result. For example, R = 0.935 with 7 degrees of freedom means you can be 99 percent confident of the positive relationship between the two variables. Statistically, the probability the data happened by chance is only 1 percent.

Learnify Hub © www.0685.com All Rights Reserved