Compute the line of best fit, slope, intercept and coefficient of determination from data.
A linear regression calculator fits a straight line to a set of (x, y) data points using least squares, and reports the slope, intercept, correlation coefficient (r), and coefficient of determination (R²). Regression is the most-used predictive technique in statistics and data analysis — and the building block for more complex machine learning models.
R² ranges from 0 to 1 and represents the fraction of variance in y explained by x. R² = 0.7 means 70% of the variation in y is predictable from x; the other 30% comes from other factors or noise.
y = mx + c \;;\; m = \frac{n\sum xy - \sum x \sum y}{n \sum x^2 - (\sum x)^2}
Inputs: Pairs: (1, 2.1), (2, 4.0), (3, 6.2), (4, 7.8), (5, 10.1)
Correlation describes a statistical relationship between two variables; causation says one variable directly causes changes in another. Correlation does NOT imply causation: ice cream sales and drowning deaths correlate, but neither causes the other — both are driven by hot weather. Establishing causation requires experimental design (randomised controlled trials) or causal-inference techniques (instrumental variables, regression discontinuity).
Three main cases: (1) clearly nonlinear relationships (use polynomial or transformation), (2) heteroscedasticity (residuals get larger with x), (3) influential outliers (a single point can shift the line dramatically). Always plot the data first. If the scatter looks linear and homoscedastic, linear regression is appropriate. Otherwise consider robust regression, log transformation, or nonlinear models.
EMI Calculator Mortgage Calculator SIP Calculator Compound Interest GST / VAT Calculator Salary Calculator Unit Converter Currency Converter Scientific Calculator Concrete Calculator Paint Calculator Tile Calculator Calorie / TDEE Body Fat Macro Calculator O-Ring Sizes Bolt & Nut Sizes Pipe Sizes Wire Gauge AWG Needle Gauge Chart IV Cannula Sizes Suture Sizes Catheter French Sizes Drug Dosage See all 90+ calculators ›