Linear Regression Calculator
This free linear regression calculator finds the line of best fit for your x and y data, with the slope, intercept, correlation coefficient r, r², p-values, a scatter plot, a residuals table and the full step-by-step working using your own numbers. It follows the TI-84 LinReg(ax+b) format, compares quadratic, exponential, power and logarithmic fits, and shows the exact TI-84 keys for the same data. Results update as you type.
How to Use the Linear Regression Calculator
- Enter your data. In X, Y pairs, type one pair per line, such as
3, 5. You can paste two columns straight from Excel or Google Sheets, and a header row likeHours Scoreis skipped. Prefer two lists? Switch to Separate X and Y lists, just like L1 and L2 on a TI-84. - Read the equation. The calculator shows
y = ax + bwith the slope a, the intercept b, r and r² in the highlighted boxes. - Predict a value. Type an x in Predict y at x = to get ŷ, plus a 95% confidence interval for the mean and a 95% prediction interval for a single new value. You get a warning if x is outside your data range.
- Try other models. Pick quadratic, exponential, power or logarithmic in Model, or press Plot in the comparison table, to draw that curve next to the straight line.
- Check, copy or share. Open the residuals table and residual plot to check the fit. Copy results copies a text summary, and Copy share link copies a link that reopens the calculator with your data.
Linear Regression Formulas
Least-squares regression picks the line that makes the sum of the squared vertical distances from the points to the line (the residuals) as small as possible. With n pairs:
Slope: a = Sxy / Sxx = [nΣxy − ΣxΣy] / [nΣx² − (Σx)²]
Intercept: b = ȳ − a·x̄
Correlation coefficient: r = Sxy / √(Sxx · Syy), and the coefficient of determination is r².
Here Sxx = Σx² − (Σx)²/n, Syy = Σy² − (Σy)²/n and Sxy = Σxy − (Σx)(Σy)/n. The standard error of the estimate is s = √[SSE / (n − 2)], the slope’s standard error is s / √Sxx, and the slope t-test uses t = a / SE(a) with n − 2 degrees of freedom.
Worked Example
Take the example data (1, 2), (2, 4), (3, 5), (4, 4), (5, 6), (6, 8), (7, 7). Here n = 7, Σx = 28, Σy = 36, Σx² = 140, Σxy = 168 and Σy² = 210.
- Sxx = 140 − 28²/7 = 28, and Sxy = 168 − 28 × 36 / 7 = 24.
- Slope a = 24 / 28 = 0.8571, and the intercept b = 36/7 − 0.8571 × 4 = 1.7143.
- Syy = 210 − 36²/7 = 24.857, so r = 24 / √(28 × 24.857) = 0.9097 and r² = 0.8276.
The regression line is y = 0.8571x + 1.7143. About 83% of the variation in y is explained by x, and the slope’s p-value is 0.0045, so the relationship is statistically significant at the 5% level. At x = 8, the predicted value is ŷ = 8.5714.
How to Do Linear Regression on a TI-84 Plus CE
- Turn on diagnostics once. Press 2nd 0 for CATALOG, scroll to
DiagnosticOnand press ENTER twice. Without this step the TI-84 hides r and r². On newer TI-84 Plus CE operating systems, you can set STAT DIAGNOSTICS to ON in MODE instead. - Enter the data. Press STAT, choose 1:Edit, type the x values in L1 and the y values in L2.
- Run LinReg. Press STAT, arrow right to CALC and choose
4:LinReg(ax+b). Set Xlist to L1, Ylist to L2, and Store RegEQ to Y1 (ALPHA TRACE, 1:Y1). Highlight Calculate and press ENTER. - Read the screen. The TI-84 shows a (the slope), b (the intercept), r² and r.
- Graph it. Turn on Plot1 under 2nd Y= (STAT PLOT), then press ZOOM 9 for ZoomStat. The line in Y1 is drawn through the scatter plot.
The calculator above repeats these steps with your own numbers and shows what the TI-84 screen should display, so you can check your work. Other models are in the same CALC menu: 5:QuadReg, 9:LnReg, 0:ExpReg and A:PwrReg. 8:LinReg(a+bx) gives the same line with the letters swapped. You can practise on our free TI-84 Plus CE calculator online, and use the standard deviation calculator to describe each variable on its own.
How to Read the Results
- Slope (a): how much y changes, on average, for each 1-unit increase in x.
- Intercept (b): the predicted y when x = 0. This value only has a real meaning if x = 0 is inside or near your data.
- r: the strength and direction of the linear relationship, from −1 to 1. Values above about 0.7 or below −0.7 are usually called strong.
- r²: the share of the variation in y that the line explains. An r² of 0.83 means 83%.
- p-value: tests whether the true slope is zero. A p-value below 0.05 is usual evidence of a real linear relationship.
- Residuals: the actual y minus the predicted y. They should scatter randomly around 0. A curve in the residual plot means a straight line is the wrong model. Points more than 2 standard errors away are highlighted as possible outliers.
Linear vs Quadratic, Exponential, Power and Log Regression
Not every relationship is a straight line. Growth that doubles at a steady rate suits exponential regression (y = a·bˣ). Curves that rise and then fall suit quadratic regression (y = ax² + bx + c). Scaling laws suit power regression (y = a·xᵇ), and fast growth that levels off suits logarithmic regression (y = a + b·ln x). The comparison table fits all five TI-84 models at once. Like the TI-84, it fits ExpReg, PwrReg and LnReg on log-transformed data. It also gives an “R² on y” for every model, so you can compare them fairly. Pick the model whose shape makes sense for your data, not just the highest R².
Correlation is not causation: a strong r shows that two variables move together, not that one causes the other.
Frequently Asked Questions
Ti84CalcPro is not affiliated with or endorsed by Texas Instruments. TI-84 Plus CE is a trademark of Texas Instruments.