E-Code

Linear regression with exact slope — a TI-89 Titanium program

By E-Code · updated

REGR89 is a TI-89 BASIC program for the TI-89 Titanium. Least-squares line through lists of X and Y: slope and intercept kept exact when the data are exact (7/5, not 1.4), correlation r and r², and a prediction at any X.

What it asks for and what it shows

It asks for 3 values at its prompts. In the example below it shows SLOPE, INTERCEPT, R, R², YHAT.

Example run

One of its oracle test cases: “exact slope 19/10”. The inputs are typed in order, and the results are the values the case expects on the screen.

StepValue
You enter
Input 1{1,2,3,4}
Input 2{3,5,6,9}
Input 35
The screen shows
SLOPE=19/10
INTERCEPT=1
R=0.981155781
R²=0.9626666667
YHAT=21/2

How it's checked

4 test cases, each checked against an independent method. Replayed key by key on a virtual TI-89 Titanium, they make 28 checks.

How E-Code checks every program

Run it or put it on your calculator

Related programs

All TI-89 Titanium statistics programs · All TI-89 Titanium programs