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.
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/100ft^{2}) | 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 (L_{1}) and we enter the output data (here, yield) into List 2 (L_{2}).
Step 1: Data Entry
1. Press STAT
(located above the key).
2. Press 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 .
Use the arrow keys to highlight yStat (heading for the second column), then
press .
4. Enter the data. For each data entry, type in a number, then press .
Use the arrow keys to navigate between columns. When data entry is complete, press . |
Step 2: Plotting the Data Set
1. Press STAT (located
above the key).
2. Press to select PLOT. This takes you to the
STATS PLOTS menu.
3. Press to select PLOT1. Complete the following in
the PLOT1 menu.
Turn PLOT1 On by highlighting On, then press
.
Next, the Xlist Name must be set to xStat. Move the curser past the equal sign and press to select
xStat, then press .
Move the curser to the next line to change the Ylist Name to yStat. Press F2 to select yStat,
then press .
Select the Mark. We recommend the small rectangle.
When done, press to return to the STATS PLOTS menu.
Then press again to return to the home screen.
4. Press . 5. Press to select ZOOM. 6. Press to see more options. 7. Press to select ZDATA and view the scatter plot. |
Note You can use the WIND (window) menu ( key) to adjust the view.
Note If an extraneous graph appears with the data set, press to select y(x)= and clear any functions present (use the arrow keys to highlight the function, then press ). Then press , to access the ZOOM menu, , and 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 STAT (located above the key).
2. Press to access the CALC menu.
3. Press to select LinR to conduct a linear
regression. LinR is pasted into the home screen.
4. Press LIST (located above the key).
5. Press to select NAMES.
6. We need to paste in xStat. If you do not see xStat in the lower menu, press until you find xStat, then press
the appropriate F key.
7. Once xStat is pasted, then press (the comma key).
8. Now paste yStat into the home screen by pressing the appropriate F key, then another (comma).
9. We now need to save the regression equation in the function editor. Press CATLG-VARS (located above the CUSTOM key). Press to select ALL. Press repeatedly to locate y1, then press to select y1 [if y1 does not appear in the CATLG-VARS menu, then select y, press , and manually insert the 1 by pressing ]. |
10. You are now back in the home screen. Press ENTER again to conduct the linear regression. |
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 key. Your data should be beautifully displayed on the screen with the regression line running through it. Cool! |
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.
Here, time is measured in hours and population
in biomass units.
First enter the data set. Press STAT
(located above the key), then
to select
EDIT and
return to the spreadsheet. To clear the old data, use the thumb pad to highlight xStat, then press
.
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 to select y(x)=, CLEAR any functions, then EXIT. Press to select ZOOM, press , then to select ZDATA. You now have a view of the scatter plot. |
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=ab^{x}. 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 STAT (located above the key). 2. Press to select CALC. 3. Press to select ExpR, exponential regression. You are then returned to the home screen with the prompt ExpR. 4. Press LIST (located above the key). 5. Press to select NAMES. 6. We need to paste in xStat. If you do not see xStat in the lower menu, press until you find xStat, then press the appropriate F key. 7. Once xStat is pasted, then press (the comma key). 8. Now paste yStat into the home screen by pressing the appropriate F key, then another (comma).
9. We now need to save the regression equation in the function editor. Press CATLG-VARS (located above CUSTOM ). Press to select ALL. Press repeatedly to locate and select y1, then press . |
10. Press 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. |
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 key. Note You can use the Trace feature to trace either the data points or the exponential curve. |
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
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
Accordingly, the initial population, f (0), and carrying capacity, K, are calculated by
and K =
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 to see more of the graph menu, then press to select MATH. Press the key two more times, then press to select TANLN. Now simply enter the input value at which you want the tangent line (here, 4), then .
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. |
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