College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
1
Appendix
Regression Analysis
And The Calculator
The Calculator:
The commands in this document are based on the TI-83 and TI-84. If you are using the
TI-82, the commands are similar and in cases where the commands are drastically
different we have tried to make note of that.
A least square regression is used to determine a simple line through a given set of points,
The process can take a large number of calculations and thus a large amount of time.
Fortunately, today’s calculators can perform these operations very quickly. The
remainder of this appendix is designed to help someone develop the skills necessary to
quickly and correctly determine an appropriate equation to represent a set of data. The
skills listed below will be presented in the following sections:
1) Entering data points
2) Graphing points
3) Calculating regression equations and graphing
4) Turning off plots and associated error messages. (This causes a lot of problems
latter and it is important that you read this.)
5) Some information on the appropriate uses of regression equations.
This appendix is based on a calculator not having data points currently stored in the
memory, if your calculator has data points stored in the memory, you may want to read
section 4, Turning off plots and associated error messages first.
Entering data points.
Since the goal of a regression analysis is to find the best equation which approximates a
set of points, our first goal is to learn to enter points into the calculator. To begin, let’s
use the following set of points:
{ (1, 2), (2, 3.2), (3, 6), (4, 8), (5, 9), (10, 9.89) }
To enter these as points into the calculator, press the STAT key. The screen should appear
as follows:
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
2
To enter points, we want to edit our data. Since EDIT and Edit are highlighted, we only
need to press the ENTER key to move to the next screen.
Frequently, we allow L1 to represent the list of x values and L2 to represent the list of y
values. Therefore, we just need to begin by entering each x value in list 1. After entering
the first x value, press the ENTER key to move to the next row.
Using the arrow keys, move the cursor over to the second list and begin typing the y
values. Since the original list of data points are ordered pairs, make sure that the values
for the y values are matched up with the corresponding x values.
Once this is done, the list of data points have been entered into the calculator. Make sure
the data points have been entered correctly. Notice that in the fifth row, we have entered
the point (5, 7), however, our original point was (5, 9). To correct this, we simply use the
arrow keys to return to the cell that contains a 7 and change it to a 9.
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
3
Thus, we have correctly entered all of our points.
Graphing data points:
To graph data points, we need to turn on a stat plot. The combination of the 2ND key and
the Y= key represents the STAT PLOT key. Press these two keys and the following screen
should appear:
This basically indicates that there is the possibility of three different plots at one time.
We are only interested in turning on one plot. To do this, press the ENTER key. To obtain
the following window:
Notice, in our display, a black box appears where a blinking box and the word On should
be on your display. Press the ENTER key and the word On should be highlighted with
the word off no longer highlighted. Also you can use the arrows to move around on the
screen to other items. The next screen has the word On highlighted with the cursor
moved over the L in L1 and the blinking cursor appears to have a capitol A in it.
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
4
You have successfully turned on the first plot. Before we move on to graphing, let’s look
closer at this screen. Besides being able to turn on and off the plot, you are able to:
1) change the type of plot that you will be working with. For the purpose of college
algebra, we are only interested in the first type of plot, thus the other five types
will be left to other classes.
2) We placed the x values in the list, L1, and the y values in the list, L2. Had we used
other lists for the data, we can change this information at this time. In college
algebra, we will always use the first list for the x values and the second list for the
y values.
3) Since we can plot up to three sets of data at the same time, the TI series of
calculators allows us to use different markers for each plot, making it possible to
distinguish one plot from the other. Most of the time, we will only plot one plot
at a time and the box is the easiest to see, therefore, we recommend that you use
the box.
To graph our data points, press the GRAPH key. If you have done everything
successfully, you will obtain the following screen:
Notice that the last point fades off of the graph. This is because we are using the standard
window settings and the last point is barely in the window. To see the window settings
press the WINDOW key. Our window settings are as follows:
If we look at the data, we will notice that one possible set of window settings would be to
let Xmin = -2, Xmax = 13, Ymin = -2 and Y max = 13. Move your cursor around and
change the settings. Notice that –2 is negative two and not minus two. Thus, you need to
be careful to use the minus sign in front of the two. The minus sign is found at the
bottom of you calculator keyboard and looks like (-). You should have the following
window:
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
5
Pressing the GRAPH key again, should give the following display:
Calculating regression equations and graphing:
With the points entered into the calculator, we can now use the calculator to find a line
that best fits these points. The words best fit are determined by mathematical needs. We
will allow these words to represent best fit as determined by a linear regression. Other
methods are described in details in more advanced math classes.
To use your calculator to find a linear regression, press the STAT key.
We want to calculate a linear regression. Arrow over to the CALC menu.
Notice, that we not only selected the CALC menu, but we have also arrowed down to
number 4: LinReg (ax+b). This is the command for a linear regression. With the four
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
6
selected, press the ENTER key twice to calculate a linear regression for our set of data
points.
Before, discussing the linear regression, please note that your calculator may also have an
r = some value and an r2= some value. These values are called r values and have to do
with what is called the regression coefficient. The regression coefficient will be
discussed in Math 281 – Statistics and for our purposes, we can just ignore these
numbers. The display above has turned off the display of the r values. It is possible to
turn off your display of these values as well, but we will not discuss this option here.
The linear regression screen above shows that the equation is y ax b , with
a 0.8575 and b 2.775 . Thus the linear regression is
y 0.8575x 2.775
By hitting the Y= key, we can enter this equation into the calculator and graph the
equation.
Notice that the line does a reasonably good job of fitting the points we were given.
To practice with regressions a little more, if you look at the given points, you might feel
like the points portray a parabola which opens downward. Hence, you decide to compute
a quadratic regression to see how that equation fits the data set. Following the same steps
as above, except for choosing a QuadReg, we obtain the following displays.
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
Thus the quadratic regression is:
y .1857 x 2 2.973x 1.243
Entering this equation into the calculator and graphing gives:
Thus, which equation does a better job of fitting the data points? If you had to choose
one equation as a model for your data points which would it be and why? This question
will be looked at further in the last section of this appendix.
Before moving on, we would like to challenge the more able user of the calculator. In
the above instructions, we hand entered the regression equations the calculator. This
leaves room for mistakes in the entry process. These can be avoided by finding the
commands which will allow you to have your calculator move the regression equation
directly into the Y= screen. Can you figure out how to do this?
Turning off plots and associated error messages.
Before we turn off plots, lets begin by looking at some error messages which frequently
occur.
Return to the screen with the list of data points. (Press the STAT key and chose EDIT, 1 Edit.
This choice can be accomplished by just pressing the STAT key and then the ENTER key.)
7
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
8
For some reason, you decide to remove the 3.2 from L2, place the cursor over the 3.2 and
press the DEL (delete) key in the top row. This will remove the 3.2 and move every
entry up in this column.
At this time, the number of entries for x values and the number of entries for y values are
no longer the same. There is a point (10, ??). How will the calculator respond to this
point. Press the GRAPH key. Your display should now have an error message as follows:
This message expresses that there is a dimension mismatch. In other words, the number
of x values does not match the number of y values. At this time, you must press the
ENTER key before the calculator will let you do anything else.
To fix this problem, we decide to clear both sets of values as we are not interested in
graphing the points. To clear the lists, press STAT, ENTER and return to the lists. Use
the arrow keys to move the cursor and highlight the L2 at the top of the list. Then press
the CLEAR key and the ENTER key. This last step will remove all numbers from the
list.
Repeat these actions for the first list.
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
9
With both lists gone, try to use the graph function again.
This time the error message claims an invalid dimension. This is because the calculator
is still trying to plot a set of data points, however, there are no data points to plot. Again,
you must press the ENTER key before the calculator will let you do anything else.
Hence to avoid both sets of errors, it is best to turn off the plot when you do not want to
plot points. To turn off the plot choose STAT PLOT by pressing the 2ND key and the Y= key.
Since you want all the plots off, one way to do this is to arrow down to the number 4. and
then press the ENTER key.
When you press the ENTER key, you will return to the main calculating screen with the
words, PlotsOff, at the bottom of the screen. To complete the process, press ENTER a
second time.
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
10
While we have discussed the simplest means of turning the plots off, the TI-82 has at
least on other method and the TI-83 and TI-84 have at least two other methods to
accomplish this task. For those of you interested in the other methods, please check with
your manual or other students.
Some information on the appropriate uses of regression equations.
Note: While you may need to read this appendix early in the semester, this final section
will have much more meaning after exponential and logarithmic equations have been
covered in the class. We encourage you to read this section at this time to give you some
idea of the power of regression analysis and then reread this section at a later time to
gain additional understanding.
In our examples of calculating linear and quadratic regression equations above, we just
had data points and no information about the data points. In this case, we would most
likely use the quadratic regression. However, generally you will know a lot about the
data, where it comes from and how it was generated. Your choice of the type of
regression that you use will often be determined by the type of data and not which
equation looks
best. We will discuss three types of data which will determine the type of regression,
reserving many of the other types for more difficult math classes.
1.) Linear regression – Any type of data which grows at a constant rate.
a. Given an Olympic size swimming pool (a rectangular box, which is fifty
meters long by thirty meters wide by 2 meters deep), fill the pool with a
garden hose and the water pressure is kept at 50 p.s.i. Filling the pool in
this manner will take a long time. Thus, you collect data points with the x
value representing time and the y value representing the height of the
water. With the pool being a box shape and the water pressure being
constant the data points should be represented with a linear regression.
b. People are hired to fold cardboard boxes. They do not interfere with or
help each other when folding the boxes. Under these conditions, it is
reasonable to assume that if you doubled the number of workers, the
number of boxes folded would also double. Creating data points with the
x value being the number of workers and the y value being the number of
boxes folded by all workers in the day, a linear regression would be the
best equation to use.
2.) Quadratic regression – Any type of data which follows a parabolic path.
a. The flight of an object which is effected by gravity.
3.) Exponential regression – Any type of data which grows at a constant percent
rate of change.
a. Placing money in the bank at a constant percent interest rate.
b. Short term growth of populations.
c. Radioactive decay.
d. Human behaviors:
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
11
e. If an athlete has recovered from an injury and begins to work their way
back into shape, gathering data based on the number of days back to
training and a measure of how far the athlete is from their optimal training
performance will follow an exponential regression model.
f. If an educator is looking at a program to change behavior in the classroom,
using time as one variable and the number of occurrences of the behavior
as the other variable, the short term changes should be modeled with
exponential regression.
4.) Logistic regression – Any type of behavior which grows at a constant percent
rate of change but has an associated carrying capacity. (carrying capacity is
defined as the critical limit and threshold which can be supported by an
environmental, economical, social and or cultural system.)
a. Given a small number of rabbits, place the rabbits on an inhabitable island.
Let one variable be time and the other variable be the population of
rabbits. This population will grow at a constant percent growth rate but as
the population approaches the carrying capacity, it will slow down the
growth rate.
b. Thus, any of the exponential models listed above, if the model has a
carrying capacity and the model is allowed enough time to approach the
carrying capacity.
To look at exponential and logistic regressions, lets reexamine our original data. If you
have removed the data from your calculator, please reenter the data.
If we know how the data was originated, we would have a much better chance of
choosing the best regression for the data. This data was meant to represent a population
study of rabbits on an island. The numbers have been adjusted to better fit the standard
window of a calculator. With this in mind, the best regression to use is a logistic
regression. To find the regression, press STAT, arrow over to CALC and then arrow down
to B: Logistic.
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
12
Next pressing ENTER will give the regression equation.
Be Careful to correctly enter the equation which is:
y
9.917
1 12.818e .9794x
The lower case letter e represents the exponential function and will be defined in the
second half of this course. For the purposes of this activity, we can just accept the value
as found near the bottom of the left hand column of the calculator keys. To register e on
your calculator, you will need to press the 2ND key and the LN key. Be careful when
placing this equation into your calculator. The need for parenthesis will make the screen
appear as follows:
refer to the above instructions and turn your plot back on. Graph both the points and the
logistic regression.
Thus, this equation fits the data points as well as the quadratic regression did above.
However, since we know how the data points were selected, we must use the logistic
regression for the equation to be meaningful.
College Algebra
Dr. Gary Hagerty and Dr. Stan Smith – Copyright 2005
13
Finally, lets look at an exponential regression. As stated above, an exponential regression
should work well in the early stages (short term) population growth problem. It should
work well before the carrying capacity start to affect the growth rate. Thus we will
compute the exponential regression only on the first four data points of the same
problem.
Using these points and computing an exponential regression (follow instructions above
and use the correct regression -- 0: ExpReg), the following is obtained:
Thus the exponential equation is y 1.125 1.732 x . Putting this equation into Y2,
adding the two points that were removed from the data list back and graphing the entire
set of data points, the logistic regression and the exponential regression, we obtain the
following graph:
Notice that both regressions do a reasonably good job of describing the data during the
initial set of data points. Thus, if the data is short term data and does not appear to be
affected by a carrying capacity situation, the exponential regression should be used for its
simplicity.
As a reminder, when you have completed you practice with your calculator, remember to
turn off the plots. This helps insure fewer error messages.
© Copyright 2025 Paperzz