If you want to measure the strength of a relationship between two variables, you can do so by using an advanced or online calculator. You can also put your mathematical skills to use and calculate it by hand. When calculating a correlation coefficient by hand, keep in mind the following representations:
-
(x(i), y(i)) = a pair of data
-
x̅ = the mean of x(i)
-
ȳ = the mean of y(i)
-
s(x) = the standard deviation of the first coordinates of x(i)
-
s(y) = the standard deviation of the second coordinates of y(i)
Here are the steps to take in calculating the correlation coefficient:
1. Determine your data sets.
Begin your calculation by determining what your variables will be. Once you know your data sets, you'll be able to plug these values into your equation. Separate these values by x and y variables.
2. Calculate the standardized value for your x variables.
After you've determined your data sets, use the following equation to calculate a standardized value for every x(i) variable:
(z(x))(i) = (x(i) - x̅) / s(x)
3. Calculate the standardized value for your y variables.
Now that you've determined the standardized value for every x(i), do the same for each y(i) with the following equation:
(z(y))(i) = (y(i) - ȳ) / s(y)
4. Multiply and find the sum.
Now that you have the standardized values, multiply them together. For example:
(z(x))(i) x (z(y))(i)
Once you've multiplied the values, add them together to find the sum.
5. Divide the sum and determine the correlation coefficient.
For this next step, we'll use n to represent the total number of points in this data pair. Divide the sum from step four by n - 1. This will result in the correlation coefficient.