Numerical Identification of Outliers: Calculating s and Finding Outliers Manually
If you do not have the function LinRegTTest on your calculator, then you must calculate the outlier in the first example by doing the following:
First, square each |y – ŷ|.
The squares are 352, 172, 162, 62, 192, 92, 32, 12, 102, 92, 12.
Then, add (sum) all the |y – ŷ| squared terms using the formula
(Recall that yi – ŷi = εi.)
= 352 + 172 + 162 + 62 + 192 + 92 + 32 + 12 + 102 + 92 + 12
= 2,440 = SSE.
The result, SSE, is the sum of squared errors.
Next, calculate s, the standard deviation of all the y – ŷ = ε-values where n = the total number of data points.
The calculation is .
For the third exam/final exam example,
Next, multiply s by 2:
(2)(16.47) = 32.94
32.94 is two standard deviations away from the mean of the y – ŷ values.
If we were to measure the vertical distance from any data point to the corresponding point on the line of best fit and that distance is at least 2s, then we would consider the data point to be too far from the line of best fit. We call that point a potential outlier.
For the example, if any of the |y – ŷ| values are at least 32.94, the corresponding (x, y) data point is a potential outlier.
For the third exam/final exam example, all the |y – ŷ| values are less than 31.29 except for the first one, which is 35:
35 > 31.29. That is, |y – ŷ| ≥ (2)(s).
The point that corresponds to |y – ŷ| = 35 is (65, 175). Therefore, the data point (65, 175) is a potential outlier. For this example, we will delete it. (Remember, we do not always delete an outlier.)
When outliers are deleted, the researcher should either record that data were deleted, and why, or the researcher should provide results both with and without the deleted data. If data are erroneous and the correct values are known (e.g., student 1 actually scored a 70 instead of a 65), then this correction can be made to the data.
The next step is to compute a new best-fit line using the 10 remaining points. The new line of best fit and the correlation coefficient are
ŷ = –355.19 + 7.39x and r = .9121.
Using this new line of best fit (based on the remaining 10 data points in the third exam/final exam example), what would a student who receives a 73 on the third exam expect to receive on the final exam? Is this the same as the prediction made using the original line?
Using the new line of best fit, ŷ = –355.19 + 7.39(73) = 184.28. A student who scored 73 points on the third exam would expect to earn 184 points on the final exam.
The original line predicted ŷ
= –173.51 + 4.83(73) = 179.08, so the prediction using the new line with the outlier eliminated differs from the original prediction.
Try It 12.13
The data points for the graph from the third exam/final exam example are as follows: (1, 5), (2, 7), (2, 6), (3, 9), (4, 12), (4, 13), (5, 18), (6, 19), (7, 12), and (7, 21). Remove the outlier and recalculate the line of best fit. Find the value of ŷ when x = 10.
The consumer price index (CPI) measures the average change over time in prices paid by urban consumers for consumer goods and services. The CPI affects nearly all Americans because of the many ways it is used. One of its biggest uses is as a measure of inflation. By providing information about price changes in the nation’s economy to government, businesses, and labor forces, the CPI helps them make economic decisions. The president, U.S. Congress, and the Federal Reserve Board use CPI trends to formulate monetary and fiscal policies. In the following table, x is the year and y is the CPI.
- Draw a scatter plot of the data.
- Calculate the least-squares line. Write the equation in the form ŷ = a + bx.
- Draw the line on a scatter plot.
- Find the correlation coefficient. Is it significant?
- What is the average CPI for the year 1990?
- See Figure 12.19.
- Using our calculator, ŷ = –3204 + 1.662x is the equation of the line of best fit.
- See Figure 12.19.
- r = 0.8694. The number of data points is n = 14. Use the 95 Percent Critical Values of the Sample Correlation Coefficient table at the end of Chapter 12: In this case, df = 12. The corresponding critical values from the table are ±0.532. Since 0.8694 > 0.532, r is significant. We can use the predicted regression line we found above to make the prediction for x = 1990.
- ŷ = –3204 + 1.662(1990) = 103.4 CPI.
In the example, notice the pattern of the points compared with the line. Although the correlation coefficient is significant, the pattern in the scatter plot indicates that a curve would be a more appropriate model to use than a line. In this example, a statistician would prefer to use other methods to fit a curve to these data, rather than model the data with the line we found. In addition to doing the calculations, it is always important to look at the scatter plot when deciding whether a linear model is appropriate.
If you are interested in seeing more years of data, visit the Bureau of Labor Statistics CPI website (ftp://ftp.bls.gov/pub/special.requests/cpi/cpiai.txt). Our data are taken from the column Annual Avg. (third column from the right). For example, you could add more current years of data. Try adding the more recent years: 2004, CPI = 188.9; 2008, CPI = 215.3; and 2011, CPI = 224.9. See how this affects the model. (Check: ŷ = –4436 + 2.295x; r = 0.9018. Is r significant? Is the fit better with the addition of the new points?)
Try It 12.14
The following table shows economic development measured in per capita income (PCINC).
- What are the independent and dependent variables?
- Draw a scatter plot.
- Use regression to find the line of best fit and the correlation coefficient.
- Interpret the significance of the correlation coefficient.
- Is there a linear relationship between the variables?
- Find the coefficient of determination and interpret it.
- What is the slope of the regression equation? What does it mean?
- Use the line of best fit to estimate PCINC for 1900 and for 2000.
- Determine whether there are any outliers.