Casio CFX-9850
TechSkills 2: Regression

In this TechSkills module, we take a given data set and fit an appropriate function to the data. The formal process of fitting a function to a given data set is called regression. Regression is a formal component of statistics. We start with fitting the simplest type of function, a linear function.

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.

Plot123 45678 9101112
Fertilizer, X (lbs/100ft2)0 0551010151520202525
Yield, Y (bushels)46107 12 10 15 17 18 21 23 22

Our first task is to enter the data set into the Casio. Fortunately, the Casio makes this a simple task. Turn the calculator on, and then press the Menu.gif key to display the MAIN MENU. Press 2.gif to select the STAT menu. A spreadsheet is now displayed. Enter the fertilizer amounts in List 1 and the corresponding yields in List 2. Use the thumb pad to navigate from List 1 to List 2. To enter the fertilizer amounts in List 1, press 0.gif Exe.gif ,0.gif Exe.gif , 5.gif Exe.gif , 5.gif Exe.gif , ..., 25 Exe.gif . Then use the thumb pad to navigate to List 2. To enter the yields in List 2, press 4.gif Exe.gif , 6.gif Exe.gif , 10 Exe.gif, 7.gif Exe.gif,..., 22 Exe.gif. Note that a specific number is not actually placed into the list until you press the Exe.gif key.

After the data set has been entered and checked for accuracy, we are ready to see a plot of the data. Press the f1.gif key to access the GRPH menu. Press f1.gif to select GPH1, statistical graph 1. A plot of the data set appears.

TS2FIG1.gif

Notice that it looks reasonable to fit a straight line through the displayed data points. A suite of regression types appears at the bottom of the screen.

Press f1.gif to select X, the Casios symbol for linear regression. The screen then displays the LinearReg screen with the values for the linear form y = ax+b for the straight line of best fit. Here, to three decimal places, the linear equation of best fit is y = .717x + 4.786. TS2FIG2.gif

Press f5.gif to select COPY to copy the linear regression equation into the Graph Func editor.

Press Exe.gif to store the regression equation as function Y1 in the Graph Func menu and return to the LinearReg screen; otherwise, press Exi.gif to return to the LinearReg screen.

Press f6.gif to select DRAW. The Casio then displays the linear regression line superimposed on the data. TS2FIG3.gif

Of course there are other functional relationships besides linear. The Casio supports a handy suite of choices, including linear, quadratic, cubic, quartic, logarithmic, exponential, power, sinusoidal and logistic.

Non-Linear 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.

table1.gif First enter the data set. Press Exi.gif to return to the spreadsheet. To clear the old data, press Exi.gif again to return to the main spreadsheet menu. Press f6.gif to access more options. Press f4.gif to select DEL-A (delete all), and then press f1.gif to select YES. Use the thumb pad to move to another column with data and delete the entries by pressing the f4.gif key, then press f1.gif to select YES. After the old data are completely cleared, then enter the new data set.

After the data are entered and checked, then we are ready for the regression. If GRPH is not displayed as the f1.gif menu item, press the f6.gif key to select more menu options until GRPH is the F1 menu item. Then press f1.gif to select GRPH. Press f1.gif to select GPH1. A plot of the data set appears. Use V-Window to adjust the viewing window; for example, Xmin: -1, max: 8, scale: 1, Ymin: 0, max: 275, scale: 50 produce the graph at right. TS2FIG4.gif

We are now ready for the regression. The problem now is, which function should we choose for the regression? No technology can tell us what function to select. Accordingly, some basic background is fundamental. Here, we want to model the growth of a biological organism. Hence, we appeal to the basic law of biological growth:

Organisms grow exponentially until acted on by some outside force.

In accordance with this basic law, we select exponential regression to give us the exponential function of best fit. Press the f6.gif key to display more options until Exp is displayed over the f2.gif key. Then press f2.gif to select Exp, exponential regression. The ExpReg screen appears. Copy the exponential equation of best fit into the Graph Func screen, then press Exe.gif to return to the ExpReg screen. Press the f6.gif key to view the exponential function overlaid on the data set. TS2FIG5.gif

Comment The simplicity with which one can enter a data set, view a plot, select a function for regression, and display the graph of the function superimposed on the data set is a major asset of the Casio CFX-9850. TS2FIG6.gif

For illustration, we conduct a quadratic regression that displays a quadratic function of best fit for the data set. Press Exi.gif to return to the spreadsheet, then press Exi.gif again to return the spreadsheet's main menu. Press f1.gif to select GRPH. Press f1.gif to select GPH1. The Casio displays a plot of the data set.

TS2FIG7.gif Press f3.gif to select X^2, Casio's symbol here for a quadratic function. The parameters (values for the coefficients) a, b, c for the quadratic function of best fit are displayed in a QuadReg screen. Here, to two decimal places, the quadratic of best fit is given by y = 6.10x2 9.28x + 16.43.

Press f6.gif to select DRAW. The quadratic equation of best fit is now overlaid on a plot of the data set. TS2FIG8.gif

Sinusoidal Regression
One models a cyclic phenomenon using the sine function. The following data set represents the average monthly temperature (F) for Eureka, California.

table2.gif

To create a sine function to model the data, we must convert the months to numbers in order to establish the domain of the function. We set January = 0, February = 1, March = 2, , December = 11.

Now access the STAT menu and clear any old data from the spreadsheet. Enter 0, 1, 2, , 11 in List 1. Then enter the temperatures in order in List 2.

After the data are entered and checked, then we are ready for the regression. Press F6 to select more menu options, then press F1 to select GRPH. Press F1 to select GPH1. A plot of the data set appears.

We are now ready for the regression. Press f6.gif to display more options until Sin appears over the f5.gif key. Press f5.gif to select Sin. The Casio displays the SinReg information for the sinusoidal curve y = asin(bx+c)+d. Here, to two decimal places, the sine function of best fit is given by y = 4.85sin(.56x2.19) + 52.87. TS2FIG9.gif

Press f6.gif to display graph of the sine function of best fit superimposed on the data set. TS2FIG10.gif

Epilog
The Casio has a rich suite of functions for fitting to data. However, the calculator cannot select for you which function to use. That is why an intelligent use of a sophisticated graphing calculator, like the Casio, must incorporate a comprehension of the basic mathematics and science at work when doing a regression. However, because of the improved technology brought by the graphing calculator, one can explore the mathematics and science at a deeper level of learning. While the Casio facilitates the calculations, it also provides the user with a tool for greater understanding and appreciation of the problem being worked.

END


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

Email: cmb22@axe.humboldt.edu
Website: http://www.humboldt.edu/~cmb2

I extend my appreciation to Casio, Inc., for its professor assistance program. You can visit the Casio web site at http://www.casio.com.