~/ learn/ afm-113/ cards/ Pooled t when the variances are equal
1 of 6

For the two grocery chains (n = 10 each; 48.6 / 5.2 vs 44.9 / 4.7), assuming equal variances, compute s_p², s_p, the SE, t and df; decide two-sided at α = 0.10 against the given t(0.05; 18) = 1.734; then build the 95 % interval with t(0.025; 18) = 2.101.

For the two grocery chains (n = 10 each; 48.6 / 5.2 vs 44.9 / 4.7), assuming equal variances, compute s_p², s_p, the SE, t and df; decide two-sided at α = 0.10 against the given t(0.05; 18) = 1.734; then build the 95 % interval with t(0.025; 18) = 2.101.

Answer

import math n1, xbar1, s1 = 10, 48.6, 5.2 n2, xbar2, s2 = 10, 44.9, 4.7 sp2 = ((n1 - 1) * s1**2 + (n2 - 1) * s2**2) / (n1 + n2 - 2) sp = math.sqrt(sp2) se = sp * math.sqrt(1 / n1 + 1 / n2) t = (xbar1 - xbar2) / se df = n1 + n2 - 2 decision = "reject" if abs(t) > 1.734 else "do not reject" print(f"sp2={sp2:.4f} sp={sp:.4f} SE={se:.4f} t={t:.3f} df={df} decision={decision}") lo, hi = (xbar1 - xbar2) - 2.101 * se, (xbar1 - xbar2) + 2.101 * se print(f"95% CI: {lo:.2f} to {hi:.2f}")

IBS1 §10.3 (pooled variance), CC BY 4.0; BCc ch 5; H-W9 (Case 2, two chains at 10 %) — shape only; original dataset

space flip · ← → navigate · esc to exit
NORMAL ~/memra/library/d0141991-95f7-4764-ae11-e34096337700/flashcard utf-8 LF