Compute the eight Northfield residuals, compare each in absolute value with the 2s threshold (s = 9.642), print the comparison, and list any outliers.
Compute the eight Northfield residuals, compare each in absolute value with the 2s threshold (s = 9.642), print the comparison, and list any outliers.
Answer
income = [35, 48, 52, 61, 70, 84, 95, 110] score = [610, 645, 640, 680, 700, 720, 745, 760] b0, b1, s = 544.1766652875465, 2.0659219418011308, 9.642 limit = 2 * s flagged = [] for x, y in zip(income, score): e = y - (b0 + b1 * x) mark = "OUTLIER" if abs(e) > limit else "ok" print(f"x={x:>3} e={e:>6.1f} vs 2s={limit:.2f} {mark}") if mark == "OUTLIER": flagged.append(x) print(f"outliers: {flagged if flagged else 'none'}")
IS1 §12.6 (the 2s outlier rule), CC BY 4.0; BCc ch 8 (homoscedasticity); pattern names as in OpenIntro Statistics 4e §8.1–8.2 (CC BY-SA, form only); original dataset