Compute Pearson's correlation coefficient r between two paired datasets.
Pearson's correlation coefficient r measures the strength and direction of the linear relationship between two variables. It ranges from −1 (perfect negative) to +1 (perfect positive). R² indicates the proportion of variance in Y explained by X.
r = Σ(xᵢ−x̄)(yᵢ−ȳ) / √[Σ(xᵢ−x̄)² × Σ(yᵢ−ȳ)²]
An r of 0 indicates no linear relationship between the variables. However, a non-linear relationship may still exist.
Correlation measures association. Two variables can be highly correlated without one causing the other — both may be driven by a third factor.