pt(-3.2, df = 5)[1] 0.01199759
Errors in Hypothesis Testing
The \(p\)-value measures how well does the null model explain the data.
The smaller the \(p\)-value, the stronger the evidence against the null model.
If the \(p\)-value is as small or smaller than \(\alpha\), we reject the null model as not being useful. We say that the result is statistically significant at level \(\alpha\). That means we falsified our mathematical model.
If the \(p\)-value is larger than \(\alpha\), we do not reject the null model. The result is not statistically significant at level \(\alpha\). In other words, the evidence does not contradict the null hypothesis.
The \(p\) value is the conditional probability of a simple random sample of size \(n\) having the \(t\)-statistic equal to or more extreme than the sample we have, given the null model is correct.
Small \(p\)-value could mean:
We have a really strange sample (unlikely if sample is simple random, but quite possible if it is not!)
There is something wrong with the model:
Suppose the \(t\)-statistic \(t = \pm 3.2\) and sample size \(n = 6\):
Left-tailed test: the area to the left of \(t\) with \(n-1\) degrees of freedom:
With \(t = -3.2\) and \(n = 6\):
pt(-3.2, df = 5)[1] 0.01199759
Right-tailed test: the area to the right of \(t\) with \(n-1\) degrees of freedom:
With \(t = 3.2\) and \(n = 6\):
1 - pt(3.2, df = 5)[1] 0.01199759
twice the area to the right of \(t\) if \(t > 0\) or left of \(t\) if \(t < 0\), with \(n-1\) degrees of freedom:
With \(t = 3.2\) and \(n = 6\):
2*(1 - pt(3.2, df = 5))[1] 0.02399518
With \(t = -3.2\) and \(n = 6\):
2*(pt(-3.2, df = 5))[1] 0.02399518
Another way: twice the area to the right of the \(\left|t\right|\)
With \(t = -3.2\) or \(t = 3.2\) and \(n = 6\):
| \(H_0\) true | \(H_0\) false | |
|---|---|---|
| reject \(H_0\) | type I error | desired |
| don’t reject \(H_0\) | desired | type II error |
\(H_0\) is never true !!!!
| \(H_0\) “true” | \(H_0\) false | |
|---|---|---|
| reject \(H_0\) | type I error | desired |
| don’t reject \(H_0\) | desired | type II error |
Let’s experiment with different null hypotheses and different sample sizes.
If \(H_0\) is really true, and samples are simple random, the probability of type I error is \(\alpha\) (except it’s really not).
When \(H_0\) is false, the probability of Type II error decreases with increasing sample size.
It also seems to depend on “how false” the null hypothesis is.
If \(H_0\) is “almost true”, so that it can be considered true for practical purposes, the probability of type I error increases with sample size.
With very large samples, the test becomes ridiculously sensitive, leading to rejection of perfectly reasonable models.
If you need the precision that comes with large samples, you should not be doing hypothesis tests. It is better to use an interval estimate instead.
Another problem is with what we call researcher degrees of freedom
All of these will affect the p-value.
How do we make sure the researchers do not (consciously or not) select the choice that will decrease the p-value?
is always (possibly a lot) larger than \(\alpha\):