You can also download a PDF copy of this lecture.
The p-value of a significance test is the probability of a value of the test statistic as or more extreme than the observed value of the test statistic when \(H_0\) is true.
The definition of the \(p\)-value depends on the alternative hypothesis. Let \(p_0\) denote the value of \(p\) hypothesized by the null and alternative hypotheses, so that the test statistic is \[ z_{\text{obs}} = \frac{\hat{p}-p_0}{\sqrt{p_0(1-p_0)/n}}. \] Here is how we define and compute the \(p\)-value.
\(H_a\!: p > p_0\). The \(p\)-value is \(P(\left. z \ge z_{\text{obs}} \right| H_0)\) (i.e., the probability of a value of \(z\) greater than or equal to the value we observed given that \(H_0\) is true).
\(H_a\!: p < p_0\). The \(p\)-value is \(P(\left. z \le z_{\text{obs}} \right| H_0)\) (i.e., the probability of a value of \(z\) less than or equal to the value we observed given that \(H_0\) is true).
\(H_a\!: p \neq p_0\). The \(p\)-value is \(P(\left. |z| \ge |z_{\text{obs}}| \ \right| H_0)\) (i.e., the probability of a value of \(z\) that is at least as large in absolute value than the value we observed given that \(H_0\) is true).
We need a resource like statdistributions.com to compute the \(p\)-value.
Note: The “\(p\)” in “\(p\)-value” is not the same as the \(p\) in the hypotheses and test statistic.
Example: How would we compute the \(p\)-values for the coin flip, pounce game, and platy examples?
Let \(\alpha\) be the significance level. The decision rule is then as follows.
Example: What would our decisions be for the coin flip, pounce game, and platy examples if \(\alpha\) = 0.05?
State the null and alternative hypotheses concerning \(p\).
Check the sample size. For the “sufficiently large sample size” we need \[ np_0 \ge 15 \ \ \ \text{and} \ \ \ n(1-p_0) \ge 15, \] where \(p_0\) is the value of \(p\) hypothesized by the null hypothesis. If these conditions are not met, then the calculation of the \(p\)-value in the fourth step below may not be accurate.
Compute the test statistic \(z = (\hat{p} - p)/\sqrt{p(1-p)/n}\).
Compute the \(p\)-value using statdistributions.com.
Make a decision by using the decision rule.
Reference | Stimulus | Correct | Total |
---|---|---|---|
100 Hz | 101 Hz | 48 | 100 |
100 Hz | 102 Hz | 54 | 100 |
100 Hz | 103 Hz | 69 | 100 |
100 Hz | 104 Hz | 72 | 100 |
Can the subject discriminate between, say, 100 Hz and 103 Hz?
Example: Does taking garlic supplements repel ticks? A study published in the Journal of the American Medical Association used a cross-over design to determine if daily consumption of garlic would reduce tick bites. A total of 66 Swedish military conscripts took 1200 mg of garlic daily during one period, and a placebo during the other period. 37 subjects reported fewer tick bites during the period they took garlic supplements. Would we conclude that garlic supplements repel (some) ticks?