TI-84 Calculator Online

How to do linear regression on a TI-84

Linear regression finds the straight line that fits your data best and tells you how good the fit is. On a TI-84 it is a list of numbers and one menu choice. Type along on the calculator on this page.

Short answer: Put x values in L1 and y values in L2 (STAT 1:Edit), then press STAT ▶ 4:LinReg(ax+b) ENTER. You get a, b, r² and r.

The example

A student tracks hours of revision against test scores:

Hours (x) 1 2 3 4 5 6
Score (y) 52 55 61 64 70 74

The question: is there a straight-line relationship, and what score does the line predict for 8 hours?

Step 1: put the data in L1 and L2

  1. Press STAT and choose 1:Edit.
  2. If L1 already has numbers, press ▲ until the name L1 at the top is highlighted, then CLEAR and ENTER. That empties the list. Do the same for L2.
  3. Move into L1 and type each x value followed by ENTER: 1, 2, 3, 4, 5, 6.
  4. Press ▶ to move to L2 and type the scores the same way: 52, 55, 61, 64, 70, 74.

Both lists must have the same number of entries. If they don't, the regression stops with ERR:DIM MISMATCH.

Step 2: run LinReg(ax+b)

  1. Press 2nd MODE (QUIT) to go back to the home screen.
  2. Press STAT, then ▶ once to reach the CALC menu.
  3. Choose 4:LinReg(ax+b). The command appears on the home screen.
  4. Press ENTER.

With no lists after it, LinReg(ax+b) uses L1 for x and L2 for y. The screen shows:

  • y=ax+b
  • a=4.514285714
  • b=46.86666667
  • r²=.9924728333
  • r=.9962293076

So the line of best fit is y = 4.51x + 46.87, rounded to two decimals.

On a TI-84 Plus CE and newer operating systems you may see a setup screen first with Xlist, Ylist, FreqList and Store RegEQ. That is the stat wizard: leave Xlist as L1 and Ylist as L2, move down to Calculate and press ENTER. The result is the same.

What the numbers mean

  • a is the slope: each extra hour of revision goes with about 4.5 more points.
  • b is the y-intercept: the line predicts about 46.9 points for zero hours.
  • r is the correlation coefficient, between −1 and 1. Here r = 0.996, a very strong positive relationship. Values near 0 mean no straight-line relationship, and a negative r means y goes down as x goes up.
  • r² is the share of the variation in y the line explains: 99.2% here.

Why r and r² are missing on some TI-84s

On a real TI-84, r and r² only appear when diagnostics are on. On a TI-84 Plus CE, press MODE and set STAT DIAGNOSTICS to ON. On an older TI-84 Plus, press 2nd 0 (CATALOG), scroll to DiagnosticOn, press ENTER twice and run the regression again. The setting stays on until you reset the calculator.

This calculator always shows r and r². DiagnosticOn is in its CATALOG too, so the keystrokes from class still work.

Step 3: graph the line of best fit

To draw the line over your data, store the equation in Y1 while you run the regression:

  1. Press STAT ▶ 4 to open LinReg(ax+b).
  2. Leave Xlist as L1 and Ylist as L2, then move down to Store RegEQ.
  3. Press VARS, then ▶ to Y-VARS, choose 1:Function and 1:Y1 (or press ALPHA TRACE for f4 and pick 1:Y1).
  4. Move to Calculate and press ENTER. (If Stat Wizards is off in MODE, type LinReg(ax+b) L1,L2,Y1 on the home screen and press ENTER.) The result ends with Y1 updated.

Now turn on the scatter plot: press 2nd Y= (STAT PLOT), choose 1, highlight On and press ENTER. Check that Xlist is L1 and Ylist is L2. Then press ZOOM 9 (ZoomStat), which sets the window to fit the data. You see the six points with the regression line through them.

Step 4: predict a value

Y1 now holds the equation, so you can evaluate it on the home screen. Press VARS ▶ 1 1 to paste Y1, then type (8) and press ENTER. Y1(8) gives 82.98095238: the line predicts about 83 points for 8 hours. Predictions far outside your data, like 30 hours, are guesses the data can't support.

You can also press TRACE, use ▲ or ▼ until the top of the screen shows Y1, then type 8 and press ENTER.

Other regressions

The CALC menu has the other models in the same place as the handheld: 5:QuadReg, 6:CubicReg, 7:QuartReg, 8:LinReg(a+bx), 9:LnReg, 0:ExpReg and A:PwrReg. They work the same way. QuadReg reports R² instead of r because a curve has no single correlation coefficient. On this data QuadReg gives R² = .9933010867, hardly better than the line, so the straight line is the sensible model.

LinReg(a+bx) is the same line written the other way round: a is the intercept and b the slope. Statistics classes often use it, so check which form your textbook wants.

Quick reference

You want Keys
Enter data STAT 1 (Edit), type in L1 and L2
Line of best fit STAT ▶ 4 ENTER
Store it in Y1 STAT ▶ 4, 2nd 1 , 2nd 2 , VARS ▶ 1 1 ENTER
Correlation r later VARS 5 (Statistics) ▶ ▶ (EQ) 7:r
Scatter plot 2nd Y= 1, On, then ZOOM 9

Questions people ask

How do I find r on a TI-84?

Run LinReg(ax+b) from STAT ▶ CALC. If r is not listed, turn diagnostics on: MODE, STAT DIAGNOSTICS ON on a TI-84 Plus CE, or CATALOG, DiagnosticOn on older models, then run it again.

What is the difference between LinReg(ax+b) and LinReg(a+bx)?

Only the letters. LinReg(ax+b) calls the slope a, LinReg(a+bx) calls the slope b. The line, r and r² are the same.

Why do I get ERR:DIM MISMATCH?

L1 and L2 have a different number of entries. Open STAT 1:Edit and check both lists end on the same row.

How do I get the regression line on the graph?

Add Y1 when you run it: LinReg(ax+b) L1,L2,Y1, with Y1 from VARS ▶ 1 1. Then turn on Plot1 under 2nd Y= and press ZOOM 9.

Open the full-size calculator