TI-86
TechSkills 2: Regression

In this module we exploit the TI-86's statistical features to obtain a function that best describes a given data set from some point of view. The user must first decide on a kind of function to use, then the TI-86 finds an equation of best fit for that function. Once we have a function, then we can apply mathematical techniques for analysis.

The process of obtaining a function of best fit is called regression. The TI-86 supports a variety of functions for regression: linear, quadratic, cubic, quartic, power, exponential, logarithmic, sinusoidal, and logistic. We first illustrate with linear regression.

Linear Regression
Linear regression is the process of fitting a straight line to a data set. A linear function has the form y = ax + b. Hence, the task of linear regression is to determine values for a and b that create the straight line that best fits the given data. For example, we consider a data set from Sullivan and Sullivan, Precalculus enhanced with graphing utilities, Second Edition, page 112, Example 3.

Plot 1 2 3 4 5 6 7 8 9 10 11 12
Fertilizer, X (lbs/100ft2) 0 0 5 5 10 10 15 15 20 20 25 25
Yield, Y (bushels) 4 6 10 7 12 10 15 17 18 21 23 22

First we enter the data set into the calculator. The TI-86 data editor is arranged in columns. A column is formally referred to as a list. Accordingly, we enter the input data (here, fertilizer) into List 1 (L1) and we enter the output data (here, yield) into List 2 (L2).

Step 1: Data Entry

1. Press 2nd.gif STAT (located above the Add.gif key).
2. Press f2.gif to select EDIT.

If the spreadsheet is empty, go to item 4.
To clear the spreadsheet, complete item 3.

3. Use the arrow keys to highlight xStat (heading for the first column), then press Cle.gif Ent.gif.
Use the arrow keys to highlight yStat (heading for the second column), then press Cle.gif Ent.gif.

4. Enter the data. For each data entry, type in a number, then press Ent.gif. Use the arrow keys to navigate between columns.
When data entry is complete, press Exi.gif.
ts2fig1.gif

Step 2: Plotting the Data Set

1. Press 2nd.gif STAT (located above the Add.gif key).
2. Press f3.gif to select PLOT. This takes you to the STATS PLOTS menu.
3. Press f1.gif to select PLOT1. Complete the following in the PLOT1 menu.
Turn PLOT1 On by highlighting On, then press Ent.gif.
Next, the Xlist Name must be set to xStat. Move the curser past the equal sign and press f1.gif to select xStat, then press Ent.gif.
Move the curser to the next line to change the Ylist Name to yStat. Press F2 to select yStat, then press Ent.gif.
Select the Mark. We recommend the small rectangle.
When done, press Exi.gif to return to the STATS PLOTS menu.
Then press Exi.gif again to return to the home screen.
4. Press Gra.gif.
5. Press f3.gif to select ZOOM.
6. Press Mor.gif to see more options.
7. Press f5.gif to select ZDATA and view the scatter plot.
ts2fig2.gif

Note You can use the WIND (window) menu (f2.gif key) to adjust the view.

Note If an extraneous graph appears with the data set, press f1.gif to select y(x)= and clear any functions present (use the arrow keys to highlight the function, then press Cle.gif). Then press Exi.gif, f3.gif to access the ZOOM menu, Mor.gif, and f5.gif to select ZDATA.

Step 3: The Calculations
Now we fit a straight line through the data points. Of course, two points uniquely determine a straight line. Although our twelve points don't fit exactly on any straight line, the TI-86 has a built in feature called linear regression that determines the straight line that best fits the data. In statistics, this line of best fit is called a regression line.

1. Press 2nd.gif STAT (located above the Add.gif key).
2. Press f1.gif to access the CALC menu. 3. Press f3.gif to select LinR to conduct a linear regression. LinR is pasted into the home screen.
4. Press 2nd.gif LIST (located above the Sub.gif key).
5. Press f3.gif to select NAMES.
6. We need to paste in xStat. If you do not see xStat in the lower menu, press Mor.gif until you find xStat, then press the appropriate F key.
7. Once xStat is pasted, then press comma.gif (the comma key).
8. Now paste yStat into the home screen by pressing the appropriate F key, then another comma.gif (comma).
9. We now need to save the regression equation in the function editor.
Press 2nd.gif CATLG-VARS (located above the CUSTOM key).
Press f2.gif to select ALL.
Press f1.gif repeatedly to locate y1, then press Ent.gif to select y1 [if y1 does not appear in the CATLG-VARS menu, then select y, press Ent.gif, and manually insert the 1 by pressing 1.gif Ent.gif].
ts2fig3.gif
10. You are now back in the home screen.
Press ENTER again to conduct the linear regression.
ts2fig4.gif

The screen displays the results of the linear regression: the regression equation is y = ax+b with y-intercept a = 4.78571429 and slope b = .717142857. We can report that the average rate of change of crop yield is .7 bushels for each pound of fertilizer per 100 square feet .

Step 4: Plotting the Data and Regression Curve Since the plot setup has already been done in viewing the data set, we are ready to graph.

1. Press the Gra.gif key.
2. Press f5.gif to select GRAPH.

Your data should be beautifully displayed on the screen with the regression line running through it. Cool!

ts2fig5.gif

Note You can use the Trace feature to trace either the data points or the regression line.

Nonlinear Regression
To illustrate obtaining a function from data, we utilize a data set for the growth of the brewers' yeast, Saccharomyces cerevisiae, obtained by the biologist Tor Carlson in 1913.
table1.gif Here, time is measured in hours and population in biomass units. First enter the data set. Press 2nd.gif STAT (located above the Add.gif key), then f2.gif to select EDIT and return to the spreadsheet. To clear the old data, use the thumb pad to highlight xStat, then press Cle.gif Ent.gif. Similarly, clear the yStat column. After the old data set is cleared, then enter the new data set.
After the data are entered and checked, then we are ready to view the scatter plot. Press GRAPH. We now clear the previous regression equation: press f1.gif to select y(x)=, CLEAR any functions, then EXIT. Press f3.gif to select ZOOM, press Mor.gif, then f5.gif to select ZDATA. You now have a view of the scatter plot. ts2fig6.gif

Step 3: The Calculations
We are now ready to fit a function to the data. For this we must first decide on a function whose graph looks like a good descriptor for the data. From merely looking at the data and mentally overlaying a smooth curve through the points, we envision a curve that is increasing and describing growth, suggesting an exponential function. No calculator or computer can make this decision. You make this decision using your knowledge of mathematics and the science of the background reality. For the TI-86, the general exponential function is y=abx. Using exponential regression, the TI-86 will determine the values for a and b that provide a general exponential function of best fit based on the given data.
The calculations and plots are done exactly as in linear regression, with one exception. In the STAT CALC menu, instead of selecting item 4:LinReg (ax+b) for linear regression, we select item 0:ExpReg. Notice that the TI-86 can accommodate a variety of function choices: linear, quadratic, cubic, quartic, logarithmic, exponential, power, logistic, and sine functions. For convenience, we summarize the calculations and viewing the scatter plot with the regression equation.

1. Press 2nd.gif STAT (located above the Add.gif key). 2. Press ts2fig6.gif to select CALC. 3. Press f5.gif to select ExpR, exponential regression. You are then returned to the home screen with the prompt ExpR. 4. Press 2nd.gif LIST (located above the Sub.gif key). 5. Press f3.gif to select NAMES. 6. We need to paste in xStat. If you do not see xStat in the lower menu, press Mor.gif until you find xStat, then press the appropriate F key. 7. Once xStat is pasted, then press comma.gif (the comma key). 8. Now paste yStat into the home screen by pressing the appropriate F key, then another comma.gif (comma).
9. We now need to save the regression equation in the function editor.
Press ts2fig6.gif CATLG-VARS (located above CUSTOM ).
Press f2.gif to select ALL.
Press f1.gif repeatedly to locate and select y1, then press Ent.gif.
ts2fig7.gif
10. Press Ent.gif again to conduct the exponential regression. The screen now displays the results of the exponential regression: the regression equation is y = a*b^x where a = 10.9756949 and b = 1.58983683. ts2fig8.gif

Step 4: Plotting the Data and Regression Curve
Since the plot setup has already been done in viewing the data set, we are ready to graph.

1. Press the Gra.gif key.
2. Press f5.gif to select GRAPH.

Note You can use the Trace feature to trace either the data points or the exponential curve.

ts2fig8.gif

Logistic Regression
One does logistic regression by following the directions given in Nonlinear Regression. However, the equation returned by logistic regression is not the basic logistic equation. The general form of the basic logistic equation is

math_eq2.gif

where K is the carrying capacity and r is the intrinsic growth rate. However, the TI-86 returns the logistic with a vertical translation in the form

math_eq3.gif

Accordingly, the initial population, f (0), and carrying capacity, K, are calculated by

math_eq4.gif and K = math_eq5.gif

We conclude with an additional step for students in calculus.

A Tangent Line
Your TI-86 can draw a tangent line to a function at a specified point. The slope of the tangent line at a given time, say at time t = 4 hours, is our desired estimation for the instantaneous rate of change of the population with respect to time, t, at t = 4. Here is how it works. We suppose that the screen is showing a plot of the data and a graph of the exponential regression curve.

Press Mor.gif to see more of the graph menu, then press f1.gif to select MATH. Press the Mor.gif key two more times, then press f1.gif to select TANLN. Now simply enter the input value at which you want the tangent line (here, 4), then Ent.gif.

ts2fig9.gif Soon the tangent line will be drawn and the slope displayed. Notice how in the vicinity of t = 4 the curved exponential and the tangent line are basically indistinguishable. Accordingly, we use the slope of the tangent line as a measure of the instantaneous rate of change. Here, the slope of the tangent line is displayed as dy/dx = 32.509857887. Accordingly, we report: based on the given data, after 4 hours of growth the population is growing at the rate of 32.5 biomass units per hour.
Suppose now that you would like to estimate the slope of the tangent line at another input value. If you want to leave the old tangent line for comparison, proceed with the above instructions for obtaining the tangent line at a new input value. If you'd like to clear the current tangent line, then press Exi.gif once, then press the f2.gif key to select DRAW, then press Mor.gif twice, then press f1.gif to select CLDRAW, which clears the tangent line(s). The TI-86 replots the raw data and the exponential model. Press Exi.gif once, then repeat the above instructions for a new input value. Enjoy!

END



The author wishes to extend his appreciation to Texas Instruments for their professor assistance program. Visit the TI calculator website at http://www.ti.com.

Charles M. Biles, Ph.D.
Professor of Mathematics
Humboldt State University
Arcata, CA 95521-8299

cmb2@axe.humboldt.edu