您在這裡

Optional Collaborative Classroom Activity

26 七月, 2019 - 12:02
Available under Creative Commons-ShareAlike 4.0 International License. Download for free at http://cnx.org/contents/733d1554-5d75-4798-9e54-7dcdc1ee5690@5.40

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, x, is pinky finger length and the dependent variable, y, is height.

For each set of data, plot the points on graph paper. Make your graph big enough and use a ruler. Then "by eye" draw a line that appears to "fit" the data. For your line, pick two convenient points and use them to find the slope of the line. Find the y-intercept of the line by extending your lines so they cross the y-axis. Using the slopes and the y-intercepts, write your equation of "best fit". Do you think everyone will have the same equation? Why or why not?

Using your equation, what is the predicted height for a pinky length of 2.5 inches?

Example 6.6

A random sample of 11 statistics students produced the following data where x is the third exam score, out of 80, and y is the final exam score, out of 200. Can you predict the final exam score of a random student if you know the third exam score?

x (third exam score)

y (fnal exam score)

Table 6.2 Table showing the scores on the final exam based on scores from the third exam. 

65

175

67

133

71

185

71

163

66

126

75

198

67

153

70

163

71

159

69

151

69

159

 
media/image187.png
Figure 6.7 Scatter plot showing the scores on the fnal exam based on scores from the third exam.  
 

The third exam score, x, is the independent variable and the final exam score, y, is the dependent variable. We will plot a regression line that best "fits" the data. If each of you were to fit a line "by eye", you would draw different lines. We can use what is called a least-squares regression line to obtain the best fit line. Consider the following diagram. Each point of data is of the form (x, y) and each point of the line of best fit using least-squares linear regression has the form (x, \hat{y}).

The \hat{y} is read "y hat" and is the estimated value of y. It is the value of y obtained using the regression line. It is not generally equal to y from data.

media/image189.png
Figure 6.8
 

The term y_{0}-\hat{y}_{0}=\epsilon _{0} is called the "error" or residual. It is not an error in the sense of a mistake. The absolute value of a residual measures the vertical distance between the actual value of y and the estimated value of y. In other words, it measures the vertical distance between the actual data point and the predicted point on the line.

If the observed data point lies above the line, the residual is positive, and the line underestimates the actual data value for y. If the observed data point lies below the line, the residual is negative, and the line overestimates that actual data value for y.

In the diagram above, y_{0}-\hat{y}_{0}=\epsilon _{0} is the residual for the point shown. Here the point lies above the line and the residual is positive.

\epsilon = the Greek letter epsilon

For each data point, you can calculate the residuals or errors, y_{i}-\hat{y}_{i}=\epsilon _{i}\ for\ i = 1, 2, 3, ..., 11.

Each \left | \epsilon \right | is a vertical distance.

For the example about the third exam scores and the fnal exam scores for the 11 statistics students, there are 11 data points. Therefore, there are 11 \epsilon values. If you square each \epsilon and add, you get

(\epsilon _{1})^{2}+(\epsilon _{2})^{2}+...+(\epsilon _{11})^{2}=\sum_{i=1}^{11} \epsilon ^{2}

This is called the Sum of Squared Errors (SSE).

Using calculus, you can determine the values of a and b that make the SSE a minimum. When you make the SSE a minimum, you have determined the points that are on the line of best fit. It turns out that the line of best fit has the equation:

\hat{y}=a+bx

where a=\bar{y} -b\cdot \bar{x}and
b=\frac{\sum (x-\bar{x})\cdot (y-\bar{y})}{\sum (x-\bar{x})^{2}}

\bar{x} and \bar{y} are the sample means of the x values and the y values, respectively. The best fit line always passes through the point (\bar{x}, \bar{y}).

The slope b can be written as b=r\cdot \left ( \frac{s_{y}}{s_{x}} \right )where s = the standard deviation of the y values and sx the standard deviation of the x values. r is the correlation coefficient which is discussed in the next section.

Least Squares 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.

Note: 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 shown below:

media/image197.png
Figure 6.9 Exam Score
 

The least squares regression line (best fit line) for the third exam/final exam example has the equation:

\hat{y}=-173.51+4.83x

Note: 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 y given x within the domain of x-values in the sample data, but not necessarily for x-values outside that domain.

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 y given x within the domain of x-values in the sample data, but not necessarily for x-values outside that domain.

You could use the line to predict the final exam score for a student who earned a grade of 73 on the third exam.

You should NOT use the line to predict the final exam score for a student who earned a grade of 50 on the third exam, because 50 is not within the domain of the x-values in the sample data, which are between 65 and 75.

UNDERSTANDING SLOPE

The slope of the line, b, describes how changes in the variables are related. It is important to interpret the slope of the line in the context of the situation represented by the data. You should be able to write a sentence interpreting the slope in plain English.

INTERPRETATION OF THE SLOPE: The slope of the best fit line tells us how the dependent variable (y) changes for every one unit increase in the independent (x) variable, on average.

THIRD EXAM vs FINAL EXAM EXAMPLE

Slope: The slope of the line is b 4.83.
Interpretation: For a one point increase in the score on the third exam, the fnal exam score increases by 4.83 points, on average.