This program is a shortened version of the program Regression in which more regression models are integrated. Regression has been written for the TI-83 Plus calculator. It should run as well on a TI-83 and more recent models.
Every measurement is influenced by many uncertainties. Measurement uncertainties can never be completely eliminated, so the true value for any quantity is never known exactly.
(TI images. The screen examples
Linear regression is a statistical tool that helps you to determine the "best-fitting" straight line for any given set of experimental data. In the relationship y = ax + b the constants a and b are being determined. The obtained function hands over which value is to be expected on an average for the one variable (y) at a given value of the other variable (x).
You might prefer knowing more about linear regression beforehand. If so, it is recommended to view an interactive demonstration in order to understand the basic outcomes a linear regression analysis has to offer.
|PROGRAM:REGLIN||R : ALPHA, R keys|
|ClrT||> 2ndF, PRGM > SCRN > ClrT|
|Rect:RectCursor||> 2ndF, PRGM > COORD > Rect
: : ALPHA, : keys
|ExprOn:Connect||> 2ndF, PRGM > FORM > Connect|
|DrawOFF||> 2ndF, DRAW > ON/OFF > DrawOFF|
|Print "DO BEFOREHAND:"||> 2ndF, PRGM > PRGM > Print
> 2ndF, PRGM > PRGM > "
Space : ALPHA, .. (above . key)
|Print "1. PLOTOFF"||important reminders|
|Print "2. STORE VALUES"|
|Print "INTO L1 AND L2."||L1 : 2ndF, L1 keys|
|Wait||> 2ndF, PRGM > PRGM > Wait|
|Plt1(Scattrž,L1,L2)||> 2ndF, PRGM > S_PLOT > Plt1(
> 2ndF, STAT PLOT > S.D. > Scattrž (ž : small square)
|Zm_Stat||> ZOOM > ZOOM > Stat|
|(max(L1)–min(L1))/5 → U||> MATH > NUM > max(
"→" Symbolizes the STO key
|10^(int (log (U))) → Z||10^( : 2ndF, 10x keys
> MATH > NUM > int
|U/Z → U|
|(int (√(U–1))▓+1)Z → Xscl||√ : 2ndF, √ keys (square root)
▓ : x▓ key
> VARS > WINDOW > ENTER > XY > Xscl
|(max(L2)–min(L2))/5 → V|
|10^(int (log (V))) → Z|
|V/Z → V|
|(int(√(V–1))▓+1)Z → Yscl||(square root)|
|StoWin||> ZOOM > STO > StoWin|
|Label 0||> 2ndF, PRGM > BRNCH > Label|
|0 → N : ClrT|
|Print "1 VIEW L1,L2 (END)||, : comma key|
|Print "2 Rg_ax+b|
|Print "3 ZOOM,TRACE||> TRACE|
|Print "4 STOP|
|Print "NUMBER 1-4|
|Input N||> 2ndF, PRGM > PRGM > Input|
|If N=1 Goto 1||> 2ndF, PRGM > BRNCH > If (Goto)|
|If N=2 Goto 2|
|If N=3 Goto 60|
|Xscl → TBLStep||> VARS > TABLE > TBLStep|
|End||> 2ndF, PRGM > PRGM > End|
|Print "1 Zm_Out||> ZOOM > ZOOM > Out|
|Print "2 Zm_In|
|Print "3 RESET ZOOM|
|Print "4 TRACE|
|Print "5 HOME|
|If N=1 Goto 61|
|If N=2 Goto 62|
|If N=3 Goto 63|
|If N=4 Goto 64|
|Print L1:Wait :ClrT|
|Print "Rg_ax+b "||> STAT > REG > Rg_ax+b|
|Print "a,b,r▓,r"||> VARS > STAT > ENTER > REGEQN > a (and b,r▓,r)|
|Rg_ax+b (L1,L2,Y1)||> VARS > EQVARS > ENTER > XY > Y1|
|DispG||> 2ndF, PRGM > SCRN > DispG|
|√2 → Z : Z → X_Fact||(square root)|
|Z → Y_Fact||> VARS > WINDOW > XY > X_fact|
|10^(int (log ((Xmax–Xmin)/Z))) → Xscl||> VARS > WINDOW > XY > Xmax|
|10^(int (log ((Ymax–Ymin)/Z))) → Yscl|
|Zm_Out||> ZOOM > ZOOM > Out|
|RclWin:Wait||> ZOOM > RCL > RclWin|
After putting in the program listing, you might like to see the program working.
A long tube is placed vertically and filled with a viscous liquid. (Which liquid is not?) When a bullet, being made up of steel, is let loose in the liquid, the sinking speed soon becomes constant. To determine this constant velocity, the position x is measured as a function of time t. The measuring outcome is:
Entering the Values
The time t is considered the independent variable and is measured along the horizontal axis of a graph. The position x, the dependent variable, is measured along the vertical axis. List 1 (L1) must contain values of the variable, which is to be plotted along the horizontal axis.
(TI images. The screen examples
Getting the Linear Equation and the Coefficient of Correlation
After preparing L1 and L2, run the program. A menu appears.
The produced value of the coefficient of correlation (r = 0,99952) indicates that the found linear equation is only a fair representation of the relationship between the measured t and x values. Counting the nines, that directly follow the comma in the coefficient of correlation, is a convenient way to find out the usefulness of the equation. In chemical and physical determinations the number of nines may be interpreted in this way: five nines mean an excellent representation, four nines a good one, three nines a fair one, two nines a poor one, and one nine means a very poor representation. With no nines directly behind the comma the equation is "unusable".
Viewing the Plotted Points and the Straight Line
Once the graph has been drawn, press ENTER, select option "3 ZOOM,TRACE" in the menu, press ENTER, select "4 TRACE" in the following sub-menu and press ENTER.
Press the up arrow key once to enable tracing the plotted line. Again, use the left and right arrow keys to explore the coordinates of some points of the line.
Using the TABLE function is another way to get values of points of the line. Stop the execution of the program by selecting "5:HOME" in the sub-menu and "4 STOP" in the main menu. Then call on the TABLE function. You may have to adjust the table settings using the TBLSET function.
Hein ten Horn
Top | Programs Sharp EL | Home