~/ learn/ afm-113/ cards/ Confidence interval for the slope, and testing r
1 of 5

Build the 95 % interval for Northfield’s slope with t₀.₀₂₅;₆ = 2.447, then compute the correlation-test t from r = statistics.correlation and confirm it matches the slope t of 14.42.

Build the 95 % interval for Northfield’s slope with t₀.₀₂₅;₆ = 2.447, then compute the correlation-test t from r = statistics.correlation and confirm it matches the slope t of 14.42.

Answer

import math import statistics income = [35, 48, 52, 61, 70, 84, 95, 110] score = [610, 645, 640, 680, 700, 720, 745, 760] b1, se_b1, n = 2.0659, 0.1432, 8 t_crit = 2.447 # t(0.025; 6) print(f"95% CI for slope: {b1 - t_crit * se_b1:.2f} to {b1 + t_crit * se_b1:.2f}") r = statistics.correlation(income, score) t_r = r * math.sqrt(n - 2) / math.sqrt(1 - r * r) print(f"t from r: {t_r:.2f}")

BCc ch 8 (interval for the slope); IBS1 §13.2 (test of the correlation), CC BY 4.0; IS1 §12.4 (the critical-r table as the alternative hand route); original dataset

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/b3f4e628-a7a7-46f3-8b89-a089c47bf32b/flashcard utf-8 LF