Correlation measures the strength and direction of the linear relationship between two variables.
The formula for the correlation coefficient (Pearson’s r) is:
\(r = \frac{\sum (x_i – \bar{x})(y_i – \bar{y})}{\sqrt{\sum (x_i – \bar{x})^2 \sum (y_i – \bar{y})^2}}
\)
Where:
- \((x_i)\) and \((y_i)\) are the individual sample points.
- \((\bar{x})\) and \((\bar{y})\) are the means of the (x) and (y) samples, respectively.