Hypothesis testing helps us determine whether an observed effect is statistically significant or could have occurred by chance.
The test statistic summarizes the observed data, often as a difference in sample means:
\[ \Delta\bar{X} = \bar{X}_D - \bar{X}_C \]
General notation:
\[ t = T(x_1, \dots, x_m) \]
6 mice: 3 control [18, 21, 22], 3 drug [30, 25, 20]
\[ \bar{X}_C = 20.33, \quad \bar{X}_D = 25, \quad \Delta \bar{X} = 4.67 \]
We ask whether this difference is due to the drug or due to chance.
There are \( \binom{6}{3} = 20 \) permutations. Calculate \( \Delta \bar{X} \) for each permutation. From table:
Use when \( n \) is large and exact enumeration is impractical.
See derivations and formulae: ch3_permute-resample.html
We can express \( \Delta\bar{X} \) in terms of \( \bar{x}_B \) and \( \bar{x}_{\text{null}} \):
\[ \Delta\bar{X} = \frac{n}{n_A}(\bar{x}_B - \bar{x}_{\text{null}}) \Rightarrow p = P(\bar{X}_B \geq \bar{x}_B) \]
If \( T_1 = f(T_2) \) where \( f \) is strictly increasing, then p-values are identical.
Example: \( T_1 = \Delta\bar{X}, \quad T_2 = \bar{x}_B \)
\[ \text{Var}(\hat{p}) \approx \frac{\hat{p}(1 - \hat{p})}{N} \Rightarrow \hat{p} \approx 0.0019 \pm 0.0004 \]
For two-sided alternative:
Two-sided p-value: \( 2 \times \min(p_+, p_-) = 0.3 \)