Skip to main content
[ "article:topic", "OpenStax", "interpolation", "extrapolation", "prediction", "authorname:openstax", "showtoc:no" ]
Statistics LibreTexts

12.6: Prediction

  • Page ID
  • Recall the third exam/final exam example. We examined the scatter plot 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 (\(x\)-values) range from 65 to 75. Since 73 is between the \(x\)-values 65 and 75, substitute \(x = 73\) into the equation. Then:

    \[\hat{y} = -173.51 + 4.83(73) = 179.08\]

    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.

    Example \(\PageIndex{1}\)

    Recall the third exam/final exam example.

    1. What would you predict the final exam score to be for a student who scored a 66 on the third exam?
    2. What would you predict the final exam score to be for a student who scored a 90 on the third exam?


    a. 145.27

    b. The \(x\) values in the data are between 65 and 75. Ninety is outside of the domain of the observed \(x\) 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 \(x\) and calculate a corresponding \(y\) value, the \(y\) value that you get will not be reliable.)

    To understand really how unreliable the prediction can be outside of the observed \(x\)-values observed in the data, make the substitution \(x = 90\) into the equation.

    \[\hat{y} = -173.51 + 4.83(90) = 261.19\]

    The final-exam score is predicted to be 261.19. The largest the final-exam score can be is 200.

    The process of predicting inside of the observed \(x\) values observed in the data is called interpolation. The process of predicting outside of the observed \(x\)-values observed in the data is called extrapolation

    Exercise \(\PageIndex{1}\)

    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:

    \[\hat{y} = 72.5 + 2.8x\]

    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?




    1. Data from the Centers for Disease Control and Prevention.
    2. Data from the National Center for HIV, STD, and TB Prevention.
    3. Data from the United States Census Bureau. Available online at
    4. Data from the National Center for Health Statistics.

    Chapter 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.


    Use the following information to answer the next two exercises. 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:

    \[\hat{y} = 101.32 + 2.48x\] where \(\hat{y}\) is in thousands of dollars.

    Exercise 12.6.2

    What would you predict the sales to be on day 60?



    Exercise 12.6.3

    What would you predict the sales to be on day 90?

    Use the following information to answer the next three exercises. 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:

    \[\hat{y} = 1350 - 1.2x\] where \(x\) is the number of hours and \(\hat{y}\) represents the number of acres left to mow.

    Exercise 12.6.4

    How many acres will be left to mow after 20 hours of work?


    1,326 acres

    Exercise 12.6.5

    How many acres will be left to mow after 100 hours of work?

    Exercise 12.6.7

    How many hours will it take to mow all of the lawns? (When is \(\hat{y} = 0\)?)


    1,125 hours, or when \(x = 1,125\)

    Table contains real data for the first two decades of AIDS reporting.

    Adults and Adolescents only, United States
    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

    Exercise 12.6.8

    Graph “year” versus “# AIDS cases diagnosed” (plot the scatter plot). Do not include pre-1981 data.

    Exercise 12.6.9

    Perform linear regression. What is the linear equation? Round to the nearest whole number.


    Check student’s solution.

    Exercise 12.6.10

    Write the equations:

    1. Linear equation: __________
    2. \(a =\) ________
    3. \(b =\) ________
    4. \(r =\) ________
    5. \(n =\) ________

    Exercise 12.6.11


    1. When \(x = 1985\), \(\hat{y} =\) _____
    2. When \(x = 1990\), \(\hat{y} =\)_____
    3. When \(x = 1970\), \(\hat{y} =\)______ Why doesn’t this answer make sense?


    1. When \(x = 1985\), \(\hat{y} = 25,52\)
    2. When \(x = 1990\), \(\hat{y} = 34,275\)
    3. When \(x = 1970\), \(\hat{y} = –725\) Why doesn’t this answer make sense? The range of \(x\) values was 1981 to 2002; the year 1970 is not in this range. The regression equation does not apply, because predicting for the year 1970 is extrapolation, which requires a different process. Also, a negative number does not make sense in this context, where we are predicting AIDS cases diagnosed.

    Exercise 12.6.11

    Does the line seem to fit the data? Why or why not?

    Exercise 12.6.12

    What does the correlation imply about the relationship between time (years) and the number of diagnosed AIDS cases reported in the U.S.?


    Also, the correlation \(r = 0.4526\). If r is compared to the value in the 95% Critical Values of the Sample Correlation Coefficient Table, because \(r > 0.423\), \(r\) is significant, and you would think that the line could be used for prediction. But the scatter plot indicates otherwise.

    Exercise 12.6.13

    Plot the two given points on the following graph. Then, connect the two points to form the regression line.

    Blank graph with horizontal and vertical axes.

    Figure 12.6.1.

    Obtain the graph on your calculator or computer.

    Exercise 12.6.14

    Write the equation: \(\hat{y} =\) ____________


    \(\hat{y} = 3,448,225 + 1750x\)

    Exercise 12.6.15

    Hand draw a smooth curve on the graph that shows the flow of the data.

    Exercise 12.6.16

    Does the line seem to fit the data? Why or why not?


    There was an increase in AIDS cases diagnosed until 1993. From 1993 through 2002, the number of AIDS cases diagnosed declined each year. It is not appropriate to use a linear regression line to fit to the data.

    Exercise 12.6.17

    Do you think a linear fit is best? Why or why not?

    Exercise 12.6.18

    What does the correlation imply about the relationship between time (years) and the number of diagnosed AIDS cases reported in the U.S.?


    Since there is no linear association between year and # of AIDS cases diagnosed, it is not appropriate to calculate a linear correlation coefficient. When there is a linear association and it is appropriate to calculate a correlation, we cannot say that one variable “causes” the other variable.

    Exercise 12.6.19

    Graph “year” vs. “# AIDS cases diagnosed.” Do not include pre-1981. Label both axes with words. Scale both axes.

    Exercise 12.6.20

    Enter your data into your calculator or computer. The pre-1981 data should not be included. Why is that so?

    Write the linear equation, rounding to four decimal places:


    We don’t know if the pre-1981 data was collected from a single year. So we don’t have an accurate x value for this figure.

    Regression equation: \(\hat{y} \text{(#AIDS Cases)} = -3,448,225 + 1749.777 \text{(year)}\)

    Intercept –3,448,225
    \(X\) Variable 1 1,749.777

    Exercise 12.6.21

    Calculate the following:

    1. \(a =\) _____
    2. \(b =\) _____
    3. correlation = _____
    4. \(n =\) _____


    • Barbara Illowsky and Susan Dean (De Anza College) with many other contributing authors. Content produced by OpenStax College is licensed under a Creative Commons Attribution License 4.0 license. Download for free at