Correlation Analysis

Calculate Pearson's r and Spearman's rho to assess the relationship between two variables.

#
n = 0Outcome
n = 0Risk Factor
1
2
3
4
5
6
7
8
9
10
10 Rows Γ— 2 Columns

Correlation Analysis

Enter data pairs on the left and click calculate to see the visualization and statistics.

Formula

Correlation Analysis

Pearson Correlation Coefficient (r):

r=βˆ‘(xiβˆ’xΛ‰)(yiβˆ’yΛ‰)βˆ‘(xiβˆ’xΛ‰)2βˆ‘(yiβˆ’yΛ‰)2r = \frac{\sum(x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum(x_i - \bar{x})^2 \sum(y_i - \bar{y})^2}}

Spearman Rank Correlation (ρ\rho):

ρ=1βˆ’6βˆ‘di2n(n2βˆ’1)\rho = 1 - \frac{6 \sum d_i^2}{n(n^2 - 1)}

Where:

  • did_i = difference between ranks of corresponding variables
  • n = number of observations