Statistics & Probability · intermediate
How to Do Linear Regression on a TI-84 (Plus and CE)
Linear regression on a TI-84 Plus or TI-84 Plus CE fits the best straight line through a set of paired values. You keep the x values in one list and the y values in another, ask the calculator for STAT ▸ CALC ▸ 4:LinReg(ax+b), and it returns the slope, the intercept and — once you have switched the diagnostics on — the correlation r.
The command is quick; the interpretation is where the work sits. This page covers the scatter-plot setup, the regression command, the meaning of a, b, r and r², and the one setting that silently hides r until you turn it on.
Enter the paired values
Press STAT, choose 1:Edit, and put the explanatory variable into L1 and the response variable into L2. The two columns must line up row by row: the x in the first cell of L1 belongs with the y in the first cell of L2. If the lists are different lengths the calculator raises ERR: DIM MISMATCH, which is explained on the DIM MISMATCH page.
As with any list work, check the L1 and L2 headings before typing so you are not overwriting older data. Leaving one stale entry at the bottom of a list is a frequent cause of a line that slopes the wrong way.
Switch on the scatter plot
Seeing the points before you fit anything is worth the extra minute, because it tells you whether a straight line is even sensible. Press 2nd Y= to open the STAT PLOT menu, select Plot1, and set it to On.
Plot1 Plot2 Plot3
On
Type: scatter
Xlist:L1
Ylist:L2
Mark: ■
Then press ZOOM and choose 9:ZoomStat. The window resizes to fit your data, and you should see the points rather than an empty grid. If the screen stays blank, Plot1 is still set to Off or the window is wrong.
Run LinReg(ax+b)
Press STAT, move to the CALC menu, and select 4:LinReg(ax+b). Pressing ENTER pastes the command; pressing it again runs it on L1 and L2. The setting y = a + bx is the default convention in most classes, so a is the intercept and b is the slope.
If you need the form y = ax + b instead, use 8:LinReg(a+bx) from the same menu, but check which one your course uses — the two produce the same line and only swap which letter is the slope.
Turn the diagnostics on to see r
On a fresh calculator, r and r² are hidden. To show them, press 2nd 0 to open the CATALOG, scroll to DiagnosticOn (typing D jumps near it), and press ENTER twice. The home screen will confirm the change. Run STAT ▸ CALC ▸ 4:LinReg(ax+b) again and the last two lines appear.
Read a, b, r and r²
LinReg
y=a+bx
a=43.8
b=8.4
r²=0.9938028
r=0.9968966
After DiagnosticOn
ais the y-intercept — the fitted value ofywhenxis 0.bis the slope — the predicted change inyfor a one-unit rise inx.ris the correlation coefficient, between −1 and 1. Its sign matches the slope, and its size measures how close the points sit to a straight line.r²is the coefficient of determination, the proportion of the variation inythat the line explains.
A value of r near 1 or −1 describes a strong linear pattern; a value near 0 describes a weak one. r² is easier to talk about because it is a percentage: r² = 0.99 means about 99 percent of the change in y is accounted for by x.
A worked example
Suppose five students record hours of revision (x) and a test score (y):
| x (hours) | y (score) |
|---|---|
| 1 | 52 |
| 2 | 61 |
| 3 | 68 |
| 4 | 79 |
| 5 | 85 |
The point totals are Σx = 15, Σy = 345, Σxy = 1119 and Σx² = 55, with n = 5. Applying the least-squares formulas gives a slope b = 8.4 and an intercept a = 43.8, so the fitted line is y = 43.8 + 8.4x. On this data the correlation is r ≈ 0.9969 and r² ≈ 0.9938, which tells you the points lie very close to the line.
In context, the slope means each extra hour of revision is associated with about 8.4 more marks on average, and the intercept is the score the model predicts for a student who did no revision. Be careful with that intercept: it only makes sense inside the range of x you actually measured.
Y1=43.8+8.4X Plot1 on
Draw the fitted line
To see the line on the graph, press Y= and paste the equation into Y1 using VARS ▸ Statistics ▸ EQ ▸ RegEQ. Then press GRAPH — with Plot1 still on, the points and the line appear together. Press ZOOM ▸ 9:ZoomStat if the window needs refitting. The basics of editing a graph are covered in our graphing tutorial.
Before you quote a regression, remember the ideas that pair with it: the spread of the residuals is measured with the methods on our standard deviation page. On the AP exams that allow a graphing calculator, the TI-84 Plus and CE are permitted, but the rules change from time to time, so confirm the current wording with the AP calculator policy and your teacher.
Frequently asked questions
Why does LinReg not show r on my TI-84?
The diagnostics are switched off by default on many units. Press 2nd then 0 to open the CATALOG, choose DiagnosticOn, and press ENTER twice. Run LinReg again and both r and r² appear. The setting stays on until a memory reset, so you only need to do this once.
What is the difference between r and r²?
r is the correlation coefficient, which runs from −1 to 1 and tells you the direction and strength of a linear relationship. r² is the coefficient of determination, the share of the variation in y explained by x. An r² of 0.85 means 85 percent of the change in y is explained by the line.
What does the a and b in LinReg(ax+b) mean?
The setting y = a + bx means a is the y-intercept, the value of y when x is zero, and b is the slope, the change in y for each unit increase in x. The calculator labels them a and b in that order on the output screen.
How do I show the regression line on the graph?
After running LinReg, press Y=, then VARS ▸ Statistics ▸ EQ ▸ RegEQ to paste the equation into Y1. With Plot1 set to scatter, pressing ZOOM ▸ 9:ZoomStat fits the window so both the points and the line are visible.
Why does my regression give a wrong line?
Common causes are putting x-values in L2 and y-values in L1 by mistake, leaving an old value at the bottom of one list, or the two lists having different lengths, which raises ERR: DIM MISMATCH. Check the header order before running the command.
Official references
Statements on this page are checked against the manufacturer or exam authority documentation below. Where an official source and this page disagree, the official source wins.