Sum all of your values contained in data 1. With the sample data, we get an answer of 34.
Sum all of your values from data 2. This gives us an answer of 43.
Square all of the values in each data set. The squared answers for our sample data are:
Data 1 (squared): 1, 16, 49, 81, 169
Data 2 (squared): 4, 25, 36, 64, 484
Sum each squared data set and you will get the following:
Sum of data 1 (squared): 316
Sum of data 2 (squared): 613
Multiply data 1 with data 2 and you will get the following values:
data 1 * data 2: 2, 20, 42, 72, 286
Sum the values from data 1 and data 2 and you will get a sum of 422.
Square the sum of data 1 that we found in Step 1 and you will get 1156.
Divide 1156 by 5 (the number of values in each data set). This gives you 231.2
Subtract 231.2 from the sum of data 1 (squared) that we found in Step 4. You will get an answer of 84.8. We will call this number Dx.
Square the sum of data 2 that we found in Step 2 and you will get 1849.
Divide 1849 by 5 (the number of values in each data set). This gives you 369.8.
Subtract 369.8 from the sum of data 2 (squared) that we found in Step 4. You will get an answer of 243.2. We will call this number Dy.
Multiply the sum of data 1 by the sum of data 2 and divide by 5 (the number of values in each data set) and you will get an answer of 292.4.
Subtract 292.4 from the sum of data 1 * data 2 that you found in Step 6. This will give you an answer of 129.6. We will call this number Dxy.
Calculate the square root of Dx and Dy separately to get the following answers:
Square root Dx : 9.21
Square root Dy : 15.59
Multiply the square roots that you just found in step 15 to get an answer of 143.58.
Divide Dxy (from Step 14) by 143.58 and you will have finished calculating the correlation between two data sets. The final answer is correlation = 0.903. A correlation this close to 1 suggests the two data sets are very closely related.