What formulas does this calculator use?
It finds the mean of x and of y, then sums the squared x gaps (Sxx), the squared y gaps (Syy) and the products of the gaps (Sxy). The slope is Sxy divided by Sxx, the intercept is mean y minus slope times mean x, and r is Sxy divided by the square root of Sxx times Syy.
What does the correlation r tell me?
It runs from -1 to 1. A positive r means y tends to rise with x, a negative r means y tends to fall, and a value near 0 means a straight line describes the points poorly. It measures a straight-line pattern only.
What does R squared mean?
In a fit with one x, R squared is r squared. It is the share of the ups and downs in y that the straight line accounts for in your data, between 0 and 1. It describes the fit, not the reason behind it.
Does a high R squared prove that x causes y?
No. Two things can move together because of a third factor, by chance, or because the cause runs the other way. A high R squared says the points hug a line. It does not say why. To argue for a cause you need a careful study design.
How should I type my data?
Put one pair per line, with the x value first and the y value second, separated by a comma or a space. A semicolon also separates pairs. Use plain numbers with a dot for decimals, and no units or text.
Why do two points give r of 1 or -1?
Two points always lie exactly on one straight line, so the fit is perfect whatever the numbers are. If both y values match, the tool shows 0 instead. Such a result says nothing about a real pattern, so use more points first.
Why does it say the x values must not all be identical?
If every x is the same, the points stand on a vertical line. A line of the form y = slope times x plus intercept cannot describe that, because the slope would need a division by zero.
Will the line work for curved data or outliers?
It will give numbers, but they can mislead. A curve, separate groups or one very far point can pull the line away from the rest. Look at a scatter plot, and think about your data before you rely on the fit.
Is my data uploaded?
No. The calculation runs in your browser, and the pairs you type are not uploaded.
How do I use Linear regression calculator?
Enter at least two numeric x,y pairs, one per line or separated by commas.
Is my data uploaded to a server?
No. This tool runs locally in your browser. Your input is not uploaded.