The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.   The best answers are voted up and moderated by our team

# How to calculate the sample correlation?

0
1
365 Team
0

Hi Maxim,

Here’s the formula of the sample correlation.
We need SPxy (sum of products of X and Y), SSx (sum of squares of X), and SSy (sum of squares of Y). And here’s a sample data set and the computation of the sample correlation.
The X and Y columns are the given data, X*X is the square of each value of X while Y*Y is the square of each value of Y, and finally the column X*Y is the product of X and Y values. For next step in computation, we will simply use the sums to substitute the terms in the formula for SPxy, SSx, and SSy.   Then finally substitute SPxy, SSx, and SSy in the formula of r. We get r = 0.9733285, a strong and positive correlation between X and Y.

Hope this helps.
Best,
The 365 Team

×
Complete Data Science Training