Pearson Correlation & Simple Linear Regression Engine

Takes bivariate paired observations (X,Y)(X, Y) or summary statistics, derives the least-squares regression line y=β0+β1x,y = \beta_0 + \beta_1 x\text{,} evaluates Pearson r,r\text{,} Spearman rank ρ,\rho\text{,} and standard error of regression residuals.

Your data

Sample size: 8 pairs.

Results

Fitted line: y^=40.0238+2.1369 x\hat{y} = 40.0238 + 2.1369\,x, with R2=0.9939R^2 = 0.9939.

Pearson correlation rr0.9969 (strong positive association)
Coefficient of determination R2R^299.39% of the variance in y explained
Slope β1\beta_12.1369
Standard error of the slope SE(β1)\text{SE}(\beta_1)0.0685
Slope test statistic tt31.208
Degrees of freedom6

For every 1-unit increase in xx, the predicted yy changes by 2.1369 units. The line accounts for 99.4% of the variation in yy.

Scatter plot: xx across, yy up, with the fitted line.

How this calculator works

Helps students understand the geometric and algebraic derivation of Ordinary Least Squares minimization.

Inputs: Paired coordinate arrays (x, y) or summary metrics (n,\text{(}n\text{,} xˉ,\bar{x}\text{,} yˉ,\bar{y}\text{,} sx,s_x\text{,} sy,s_y\text{,} r).r\text{).}

Outputs: Slope (β1),\text{(}\beta_1\text{),} intercept (β0),\text{(}\beta_0\text{),} correlation coefficient (r),\text{(}r\text{),} coefficient of determination (R2),\text{(}R^2\text{),} tt-test for slope significance.

Formula:

y^=β0+β1x,r=∑(xi−xˉ)(yi−yˉ)∑(xi−xˉ)2∑(yi−yˉ)2\hat{y} = \beta_0 + \beta_1 x, \quad r = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum (x_i - \bar{x})^2 \sum (y_i - \bar{y})^2}}

← All calculators