Chapter 10: Linear Regression and Correlation
10.5 Prediction
Learning Objectives
By the end of this section, the student should be able to:
- Use the line of best fit for prediction.
Recall the third exam/final exam example from Section 10.2.
We examined the scatterplot and showed that the correlation coefficient is significant. We found the equation of the best-fit line for the final exam grade as a function of the grade on the third exam. We can now use the least-squares regression line for prediction.
Suppose you want to estimate, or predict, the mean final exam score of statistics students who received 73 on the third exam. The exam scores ([latex]x[/latex] values) range from 65 to 75. Since 73 is between the [latex]x[/latex] values 65 and 75, substitute [latex]x = 73[/latex] into the equation. Then: [latex]\hat{y}=-173.51+4.83\left(73\right)=179.08[/latex]
We predict that statistics students who earn a grade of 73 on the third exam will earn a grade of 179.08 on the final exam, on average. Let's see the same third exam versus final exam example.
Example
A random sample of 11 statistics students produced the following data, where [latex]x[/latex] is the third exam score out of 80, and [latex]y[/latex] 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?
| [latex]x[/latex] (third exam score) | [latex]y[/latex] (final exam score) |
|---|---|
| 65 | 175 |
| 67 | 133 |
| 71 | 185 |
| 71 | 163 |
| 66 | 126 |
| 75 | 198 |
| 67 | 153 |
| 70 | 163 |
| 71 | 159 |
| 69 | 151 |
| 69 | 159 |
The line of best fit is: [latex]\hat{y} = -173.51 + 4.83x[/latex]
- What would you predict the final exam score to be for a student who scored a 66 on the third exam?
- What would you predict the final exam score to be for a student who scored a 90 on the third exam?
Solution
- 145.27
- The [latex]x[/latex] values in the data are between 65 and 75. Ninety is outside of the domain of the observed [latex]x[/latex] values in the data (independent variable), so you cannot reliably predict the final exam score for this student. (Even though it is possible to enter 90 into the equation for [latex]x[/latex] and calculate a corresponding [latex]y[/latex] value, the [latex]y[/latex] value that you get will not be reliable.)
To understand really how unreliable the prediction can be outside of the observed [latex]x[/latex] values observed in the data, make the substitution [latex]x = 90[/latex] into the equation.
[latex]\hat{y}=–173.51+4.83\left(90\right)=261.19[/latex]
The final-exam score is predicted to be 261.19. The highest the final-exam score can be is 200.
Note
The process of predicting inside of the observed [latex]x[/latex] values observed in the data is called interpolation. The process of predicting outside of the observed [latex]x[/latex] values observed in the data is called extrapolation.
Your Turn!
Data are collected on the relationship between the number of hours per week practicing a musical instrument and scores on a math test. The line of best fit is as follows:
[latex]\hat{y} = 72.5 + 2.8x[/latex]
What would you predict the score on a math test would be for a student who practices a musical instrument for five hours a week?
Solution
86.5
Videos
Below are helpful videos for the content covered in this Section. Videos are provided from YouTube.
Section 10.5 Review
After determining the presence of a strong correlation coefficient and calculating the line of best fit, you can use the least squares regression line to make predictions about your data.
Section 10.5 Practice
An electronics retailer used regression to find a simple model to predict sales growth in the first quarter of the new year (January through March). The model is good for 90 days, where x is the day. The model can be written as follows:
[latex]\hat{y} = 101.32 + 2.48x[/latex] where [latex]\hat{y}[/latex] is in thousands of dollars.
- What would you predict the sales to be on day 60?
- What would you predict the sales to be on day 90?
A landscaping company is hired to mow the grass for several large properties. The total area of the properties combined is 1,345 acres. The rate at which one person can mow is as follows:
[latex]\hat{y} = 1350 – 1.2x[/latex] where [latex]x[/latex] is the number of hours and [latex]\hat{y}[/latex] represents the number of acres left to mow.
- How many acres will be left to mow after 20 hours of work?
- How many acres will be left to mow after 100 hours of work?
- How many hours will it take to mow all of the lawns? (When is [latex]\hat{y} = 0[/latex]?
The table below contains real data for the first two decades of AIDS reporting.
| Year | # AIDS cases diagnosed | # AIDS deaths |
|---|---|---|
| Pre-1981 | 91 | 29 |
| 1981 | 319 | 121 |
| 1982 | 1,170 | 453 |
| 1983 | 3,076 | 1,482 |
| 1984 | 6,240 | 3,466 |
| 1985 | 11,776 | 6,878 |
| 1986 | 19,032 | 11,987 |
| 1987 | 28,564 | 16,162 |
| 1988 | 35,447 | 20,868 |
| 1989 | 42,674 | 27,591 |
| 1990 | 48,634 | 31,335 |
| 1991 | 59,660 | 36,560 |
| 1992 | 78,530 | 41,055 |
| 1993 | 78,834 | 44,730 |
| 1994 | 71,874 | 49,095 |
| 1995 | 68,505 | 49,456 |
| 1996 | 59,347 | 38,510 |
| 1997 | 47,149 | 20,736 |
| 1998 | 38,393 | 19,005 |
| 1999 | 25,174 | 18,454 |
| 2000 | 25,522 | 17,347 |
| 2001 | 25,643 | 17,402 |
| 2002 | 26,464 | 16,371 |
| Total | 802,118 | 489,093 |
- Graph “year” versus “# AIDS cases diagnosed” (plot the scatter plot). Do not include pre-1981 data.
- Perform linear regression. What is the linear equation? Round to the nearest whole number.
- Does the line seem to fit the data? Why or why not?
- Use the linear regression equation to predict when [latex]x = 1990[/latex], [latex]\hat{y} =\underline{\hspace{2cm}}[/latex].
- Use the linear regression equation to predict when [latex]x = 1970[/latex], [latex]\hat{y} =\underline{\hspace{2cm}}[/latex]. Why doesn’t this answer make sense?
- What does the correlation imply about the relationship between time (years) and the number of diagnosed AIDS cases reported in the U.S.?
The following table shows the life expectancy for an individual born in the United States in certain years.
| Year of Birth | Life Expectancy |
|---|---|
| 1930 | 59.7 |
| 1940 | 62.9 |
| 1950 | 70.2 |
| 1965 | 69.7 |
| 1973 | 71.4 |
| 1982 | 74.5 |
| 1987 | 75 |
| 1992 | 75.7 |
| 2010 | 78.7 |
- Decide which variable should be the independent variable and which should be the dependent variable.
- Draw a scatter plot of the ordered pairs.
- Calculate the least squares line. Put the equation in the form of: [latex]\hat{y} = a + bx[/latex]
- Find the correlation coefficient. Is it significant?
- Find the estimated life expectancy for an individual born in 1950 and for one born in 1982.
- Why aren’t the answers to part 5 the same as the values in the table that correspond to those years?
- Use the two points in part 5 to plot the least squares line on your graph from part 2.
- Based on the data, is there a linear relationship between the year of birth and life expectancy?
- Are there any outliers in the data?
- Using the least squares line, find the estimated life expectancy for an individual born in 1850. Does the least squares line give an accurate estimate for that year? Explain why or why not.
- What is the slope of the least-squares (best-fit) line? Interpret the slope.
The following table gives the gold medal times for every other Summer Olympics for the women’s 100-meter freestyle (swimming).
| Year | Time (seconds) |
|---|---|
| 1912 | 82.2 |
| 1924 | 72.4 |
| 1932 | 66.8 |
| 1952 | 66.8 |
| 1960 | 61.2 |
| 1968 | 60.0 |
| 1976 | 55.65 |
| 1984 | 55.92 |
| 1992 | 54.64 |
| 2000 | 53.8 |
| 2008 | 53.1 |
- Decide which variable should be the independent variable and which should be the dependent variable.
- Draw a scatter plot of the data.
- Does it appear from inspection that there is a relationship between the variables? Why or why not?
- Calculate the least squares line. Put the equation in the form of: [latex]\hat{y} = a + bx[/latex].
- Find the correlation coefficient. Is the decrease in times significant?
- Find the estimated gold medal time for 1932. Find the estimated time for 1984.
- Why are the answers from part 6 different from the chart values?
- Does it appear that a line is the best way to fit the data? Why or why not?
- Use the least-squares line to estimate the gold medal time for the next Summer Olympics. Do you think that your answer is reasonable? Why or why not?
| State | # letters in name | Year entered the Union | Rank for entering the Union | Area (square miles) |
|---|---|---|---|---|
| Alabama | 7 | 1819 | 22 | 52,423 |
| Colorado | 8 | 1876 | 38 | 104,100 |
| Hawaii | 6 | 1959 | 50 | 10,932 |
| Iowa | 4 | 1846 | 29 | 56,276 |
| Maryland | 8 | 1788 | 7 | 12,407 |
| Missouri | 8 | 1821 | 24 | 69,709 |
| New Jersey | 9 | 1787 | 3 | 8,722 |
| Ohio | 4 | 1803 | 17 | 44,828 |
| South Carolina | 13 | 1788 | 8 | 32,008 |
| Utah | 4 | 1896 | 45 | 84,904 |
| Wisconsin | 9 | 1848 | 30 | 65,499 |
We are interested in whether or not the number of letters in a state name depends upon the year the state entered the Union.
- Decide which variable should be the independent variable and which should be the dependent variable.
- Draw a scatter plot of the data.
- Does it appear from inspection that there is a relationship between the variables? Why or why not?
- Calculate the least-squares line. Put the equation in the form of: [latex]\hat{y} = a + bx[/latex].
- Find the correlation coefficient. What does it imply about the significance of the relationship?
- Find the estimated number of letters (to the nearest integer) a state would have if it entered the Union in 1900. Find the estimated number of letters a state would have if it entered the Union in 1940.
- Does it appear that a line is the best way to fit the data? Why or why not?
- Use the least-squares line to estimate the number of letters a new state that enters the Union this year would have. Can the least squares line be used to predict it? Why or why not?
Solution
- Year is the independent or [latex]x[/latex] variable; the number of letters is the dependent or [latex]y[/latex] variable.
- Check student’s solution.
- no
- [latex]\hat{y} = 47.03 – 0.0216x[/latex]
- –0.4280
- 6; 5
- No, the relationship does not appear to be linear; the correlation is not significant.
- current year: 2013: 3.55 or four letters; this is not an appropriate use of the least squares line. It is extrapolation.
References
Data from the Centers for Disease Control and Prevention.
Data from the National Center for HIV, STD, and TB Prevention.
Data from the United States Census Bureau. Available online at http://www.census.gov/compendia/statab/cats/transportation/motor_vehicle_accidents_and_fatalities.html.
Data from the National Center for Health Statistics.