Paired t-Statistic

easy
Unit 6 · Hypothesis Testing I0/3 to milestone

When the same users are measured before and after a change, test the differences di=afteri−beforeid_i = \text{after}_i - \text{before}_i:

t=dˉsd/nt = \frac{\bar d}{s_d/\sqrt n}

with sds_d the sample std of the differences (ddof=1). Implement paired_t(before, after) returning (t, df) with df = n - 1. If every difference is identical, return (inf, df) (or -inf, or 0.0 if all differences are 0).

#hypothesis-testing#statistics2 visible + 1 hidden tests
solution.py · Python 3.13
Loading editor…
Run your code to see results. ⌘↵ to run · ⌘⇧↵ to submit
Paired t-Statistic · TechGradify