Hypothesis testing


Example


Hypothesis testing

Truth Decide Result
\( H_0 \) \( H_0 \) Correctly accept null
\( H_0 \) \( H_a \) Type I error
\( H_a \) \( H_a \) Correctly reject null
\( H_a \) \( H_0 \) Type II error

Discussion


Example


Example continued

\[ \begin{align} 0.05 & = P\left(\bar X \geq C ~|~ \mu = 30 \right) \\ & = P\left(\frac{\bar X - 30}{10 / \sqrt{100}} \geq \frac{C - 30}{10/\sqrt{100}} ~|~ \mu = 30\right) \\ & = P\left(Z \geq \frac{C - 30}{1}\right) \\ \end{align} \]


Discussion


General rules


Notes


More notes


Example reconsidered


Two sided tests


T test in R

library(UsingR); data(father.son)
t.test(father.son$sheight - father.son$fheight)

    One Sample t-test

data:  father.son$sheight - father.son$fheight
t = 11.79, df = 1077, p-value < 2.2e-16
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
 0.831 1.163
sample estimates:
mean of x 
    0.997 

Connections with confidence intervals


Exact binomial test

Rejection region Type I error rate
[0 : 8] 1
[1 : 8] 0.9961
[2 : 8] 0.9648
[3 : 8] 0.8555
[4 : 8] 0.6367
[5 : 8] 0.3633
[6 : 8] 0.1445
[7 : 8] 0.0352
[8 : 8] 0.0039

Notes