11.3: The Regression Equation
( \newcommand{\kernel}{\mathrm{null}\,}\)
Data rarely fit a straight line exactly. Usually, you must be satisfied with rough predictions. Typically, you have a set of data whose scatter plot appears to "fit" a straight line. This is called a Line of Best Fit or Least-Squares Line.
COLLABORATIVE EXERCISE
If you know a person's pinky (smallest) finger length, do you think you could predict that person's height? Collect data from your class (pinky finger length, in inches). The independent variable,
Example
A random sample of 11 statistics students produced the following data, where
65 | 175 |
67 | 133 |
71 | 185 |
71 | 163 |
66 | 126 |
75 | 198 |
67 | 153 |
70 | 163 |
71 | 159 |
69 | 151 |
69 | 159 |
Figure
Exercise
SCUBA divers have maximum dive times they cannot exceed when going to different depths. The data in Table show different depths with the maximum dive times in minutes. Use your calculator to find the least squares regression line and predict the maximum dive time for 110 feet.
50 | 80 |
60 | 55 |
70 | 45 |
80 | 35 |
90 | 25 |
100 | 22 |
Answer
At 110 feet, a diver could dive for only five minutes.
The third exam score,
Consider the following diagram. Each point of data is of the the form (
The
Figure
The term
If the observed data point lies above the line, the residual is positive, and the line underestimates the actual data value for
In the diagram in Figure,
For each data point, you can calculate the residuals or errors,
Each
For the example about the third exam scores and the final exam scores for the 11 statistics students, there are 11 data points. Therefore, there are 11
Equation
Using calculus, you can determine the values of
where
and .
The sample means of the
The slope
Least Square Criteria for Best Fit
The process of fitting the best-fit line is called linear regression. The idea behind finding the best-fit line is based on the assumption that the data are scattered about a straight line. The criteria for the best fit line is that the sum of the squared errors (SSE) is minimized, that is, made as small as possible. Any other line you might choose would have a higher SSE than the best fit line. This best fit line is called the least-squares regression line .
Computer spreadsheets, statistical software, and many calculators can quickly calculate the best-fit line and create the graphs. The calculations tend to be tedious if done by hand. Instructions to use the TI-83, TI-83+, and TI-84+ calculators to find the best-fit line and create a scatterplot are shown at the end of this section.
THIRD EXAM vs FINAL EXAM EXAMPLE:
The graph of the line of best fit for the third-exam/final-exam example is as follows:
Figure
The least squares regression line (best-fit line) for the third-exam/final-exam example has the equation:
REMINDER
Remember, it is always important to plot a scatter diagram first. If the scatter plot indicates that there is a linear relationship between the variables, then it is reasonable to use a best fit line to make predictions for
Understanding Slope
The slope of the line,
INTERPRETATION OF THE SLOPE: The slope of the best-fit line tells us how the dependent variable (
THIRD EXAM vs FINAL EXAM EXAMPLE
Slope: The slope of the line is
Interpretation: For a one-point increase in the score on the third exam, the final exam score increases by 4.83 points, on average.
Using the Linear Regression T Test: LinRegTTest
- In the STAT list editor, enter the
data in list L1 and the Y data in list L2, paired so that the corresponding ( ) values are next to each other in the lists. (If a particular pair of values is repeated, enter it as many times as it appears in the data.) - On the STAT TESTS menu, scroll down with the cursor to select the LinRegTTest. (Be careful to select LinRegTTest, as some calculators may also have a different item called LinRegTInt.)
- On the LinRegTTest input screen enter: Xlist: L1 ; Ylist: L2 ; Freq: 1
- On the next line, at the prompt
or , highlight " " and press ENTER - Leave the line for "RegEq:" blank
- Highlight Calculate and press ENTER.
Figure
The output screen contains a lot of information. For now we will focus on a few items from the output, and will return later to the other items.
The second line says
The two items at the bottom are
Graphing the Scatterplot and Regression Line
- We are assuming your
data is already entered in list L1 and your data is in list L2 - Press 2nd STATPLOT ENTER to use Plot 1
- On the input screen for PLOT 1, highlight On, and press ENTER
- For TYPE: highlight the very first icon which is the scatterplot and press ENTER
- Indicate Xlist: L1 and Ylist: L2
- For Mark: it does not matter which symbol you highlight.
- Press the ZOOM key and then the number 9 (for menu item "ZoomStat") ; the calculator will fit the window to the data
- To graph the best-fit line, press the "
" key and type the equation into equation Y1. (The key is immediately left of the STAT key). Press ZOOM 9 again to graph it. - Optional: If you want to change the viewing window, press the WINDOW key. Enter your desired window using Xmin, Xmax, Ymin, Ymax
Another way to graph the line after you create a scatter plot is to use LinRegTTest.
- Make sure you have done the scatter plot. Check it on your screen.
- Go to LinRegTTest and enter the lists.
- At RegEq: press VARS and arrow over to Y-VARS. Press 1 for 1:Function. Press 1 for 1:Y1. Then arrow down to Calculate and do the calculation for the line of best fit.
- Press
. - Press GRAPH. The line will be drawn."
The Correlation Coefficient
Besides looking at the scatter plot and seeing that a line seems reasonable, how can you tell if the line is a good predictor? Use the correlation coefficient as another indicator (besides the scatterplot) of the strength of the relationship between
The correlation coefficient is calculated as
where
If you suspect a linear relationship between
What the VALUE of
- The value of
is always between –1 and +1: –1 ≤ r ≤ 1.
The size of the correlation
- If
there is absolutely no linear relationship between and (no linear correlation). - If
, there is perfect positive correlation. If , there is perfect negative correlation. In both these cases, all of the original data points lie on a straight line. Of course,in the real world, this will not generally happen.
What the SIGN of
- A positive value of
means that when increases, tends to increase and when decreases, tends to decrease (positive correlation). - A negative value of
means that when increases, tends to decrease and when decreases, tends to increase (negative correlation).
The sign of
Strong correlation does not suggest that
Figure
The formula for
The Coefficient of Determination
The variable
, when expressed as a percent, represents the percent of variation in the dependent (predicted) variable that can be explained by variation in the independent (explanatory) variable using the regression (best-fit) line. , when expressed as a percentage, represents the percent of variation in that is NOT explained by variation in using the regression line. This can be seen as the scattering of the observed data points about the regression line.
Consider the third exam/final exam example introduced in the previous section
- The line of best fit is:
- The correlation coefficient is
- The coefficient of determination is
- Interpretation of
in the context of this example: - Approximately 44% of the variation (0.4397 is approximately 0.44) in the final-exam grades can be explained by the variation in the grades on the third exam, using the best-fit regression line.
- Therefore, approximately 56% of the variation (
) in the final exam grades can NOT be explained by the variation in the grades on the third exam, using the best-fit regression line. (This is seen as the scattering of the points about the line.)
Summary
A regression line, or a line of best fit, can be drawn on a scatter plot and used to predict outcomes for the
The correlation coefficient
Glossary
- Coefficient of Correlation
- a measure developed by Karl Pearson (early 1900s) that gives the strength of association between the independent variable and the dependent variable; the formula is:
where is the number of data points. The coefficient cannot be more then 1 and less then –1. The closer the coefficient is to , the stronger the evidence of a significant linear relationship between and .