⏳ Loading example…
⚖️
t-test
Paired-Samples t-test — Before vs. After Training
Test whether a training program improved performance for the same 8 employees. Effect size d=2.94.
📊 t(7) = 8.32, p < .001, d = 2.94
Step-by-step solution
⚖️ 2 · t-Tests
2a · One-Sample t-test: Is the class average = 75?
t-test
Research Question:
The national average exam score is 75. Does a sample of 10 students differ from this standard?
Formula
$$t = \frac{\bar{x} - \mu_0}{s/\sqrt{n}}, \quad df = n - 1$$
-
1State hypotheses: H₀: μ = 75 vs H₁: μ ≠ 75 (two-tailed)
-
2$$t = \frac{79.5 - 75}{8.37/\sqrt{10}} = \frac{4.5}{2.646} = 1.700, \quad df = 9$$
-
3Critical value at α=.05, df=9: t* = ±2.262. Since |1.700| < 2.262 → Fail to reject H₀.
-
4Cohen's d (effect size):$$d = \frac{\bar{x} - \mu_0}{s} = \frac{79.5 - 75}{8.37} = 0.538 \quad (\text{medium})$$
1.700
t
9
df
.124
p
0.538
Cohen's d
⚪ Fail to Reject H₀ — The class mean (M=79.5) does not differ significantly from 75, t(9)=1.70, p=.124.
APA-7
A one-sample t-test indicated that the class mean (M = 79.50, SD = 8.37) did not significantly differ from the national standard of 75, t(9) = 1.70, p = .124, d = 0.54, 95% CI [−1.48, 10.48].
2b · Independent-Samples t-test (Welch): Drug A vs Drug B
t-test
Research Question:
Does Drug A reduce pain scores more than Drug B? (Higher score = more pain)
| Group | n | Mean | SD |
|---|---|---|---|
| Drug A | 12 | 4.2 | 1.3 |
| Drug B | 10 | 5.8 | 1.9 |
Welch t-statistic
$$t_W = \frac{\bar{x}_1 - \bar{x}_2}{\sqrt{\dfrac{s_1^2}{n_1} + \dfrac{s_2^2}{n_2}}}$$
-
1$$SE = \sqrt{\frac{1.3^2}{12} + \frac{1.9^2}{10}} = \sqrt{\frac{1.69}{12} + \frac{3.61}{10}} = \sqrt{0.1408 + 0.361} = \sqrt{0.5018} = 0.7084$$
-
2$$t_W = \frac{4.2 - 5.8}{0.7084} = \frac{-1.6}{0.7084} = -2.258$$
-
3Welch-Satterthwaite df:$$df = \frac{(s_1^2/n_1 + s_2^2/n_2)^2}{\dfrac{(s_1^2/n_1)^2}{n_1-1} + \dfrac{(s_2^2/n_2)^2}{n_2-1}} = \frac{(0.5018)^2}{\dfrac{(0.1408)^2}{11}+\dfrac{(0.361)^2}{9}} \approx 15.7 \approx 15$$
-
4Cohen's d:$$d = \frac{|\bar{x}_1 - \bar{x}_2|}{s_p}, \quad s_p = \sqrt{\frac{(n_1-1)s_1^2+(n_2-1)s_2^2}{n_1+n_2-2}} = \sqrt{\frac{11(1.69)+9(3.61)}{20}} = \sqrt{1.554} = 1.567$$$$d = \frac{1.6}{1.567} = 1.021 \quad (\text{large})$$
−2.258
t(Welch)
15
df
.039
p
1.021
Cohen's d
🔴 Reject H₀ — Drug A produces significantly lower pain scores than Drug B, t(15)=−2.26, p=.039.
APA-7
An independent-samples Welch t-test revealed that Drug A (M = 4.20, SD = 1.30) produced significantly lower pain scores than Drug B (M = 5.80, SD = 1.90), t(15.00) = −2.26, p = .039, d = 1.02, 95% CI [−3.11, −0.09].
2c · Paired-Samples t-test: Before vs After Training
t-test
Research Question:
Did a training program improve performance scores for the same 8 employees?
| i | Before | After | Diff (d) | d − d̄ | (d − d̄)² |
|---|---|---|---|---|---|
| 1 | 60 | 72 | 12 | 2.75 | 7.56 |
| 2 | 55 | 68 | 13 | 3.75 | 14.06 |
| 3 | 70 | 75 | 5 | -4.25 | 18.06 |
| 4 | 65 | 74 | 9 | -0.25 | 0.06 |
| 5 | 58 | 71 | 13 | 3.75 | 14.06 |
| 6 | 72 | 80 | 8 | -1.25 | 1.56 |
| 7 | 63 | 70 | 7 | -2.25 | 5.06 |
| 8 | 68 | 82 | 14 | 4.75 | 22.56 |
| Σ | 81 | 0 | 83.00 |
$$t = \frac{\bar{d}}{s_d / \sqrt{n}}, \quad \bar{d} = \frac{81}{8} = 10.125, \quad s_d = \sqrt{\frac{83.00}{7}} = \sqrt{11.857} = 3.443$$
$$t = \frac{10.125}{3.443/\sqrt{8}} = \frac{10.125}{1.217} = 8.320, \quad df = n-1 = 7$$
Cohen's d (paired)
$$d = \frac{\bar{d}}{s_d} = \frac{10.125}{3.443} = 2.941 \quad (\text{very large})$$
8.320
t
7
df
<.001
p
2.941
Cohen's d
10.125
Mean Diff.
🔴 Reject H₀ — Training significantly improved performance, t(7) = 8.32, p < .001, d = 2.94.
APA-7
A paired-samples t-test indicated a statistically significant improvement in performance following training (M_diff = 10.13, SD_diff = 3.44), t(7) = 8.32, p < .001, d = 2.94, 95% CI [7.25, 13.00].