How to use the simulator
The simulator has one slider and two rows of buttons:
- Observed statistic (z): −4 to 4 in steps of 0.01, starting at 1.96. Enter the standardized test statistic you calculated.
- Alternative hypothesis (tail): Left (Ha: p < p0), Right (Ha: p > p0, the default) or Two-sided (Ha: p ≠ p0).
- Significance level (α): 0.10, 0.05 (default) or 0.01.
The plot is the null distribution: a standard normal curve from −4 to 4. The P-value region is shaded in coral, and a dashed coral line marks z (plus −z in two-sided mode, where both tails are shaded). Faint dashed lines mark ±1.645, ±1.96 and ±2.576, the critical values for common levels.
The results box lists the Test statistic, the P-value with how it was found (P(Z ≤ z), P(Z ≥ z) or 2·P(Z ≥ |z|)) to four decimals, or "< 0.0001" when tiny, and α. A verdict bar then reads either REJECT H0 (statistically significant) or FAIL TO REJECT H0 (not significant).
The verdict compares the unrounded P-value with α. At z = 1.96 two-sided, the box shows 0.0500 but the verdict says reject, because the unrounded value is 0.049996. On real work, report the P-value and compare it with α yourself.
Slide z toward 0 and the shaded area grows. At z = 0, the right-tailed P-value is 0.5000 and the two-sided P-value is 1.0000: a statistic right at the center of the null distribution is no evidence against at all.
Try z = 1.96 with Right, then with Two-sided: the P-value doubles from 0.0250 to 0.0500. The same statistic is less convincing when the alternative did not predict a direction.
The formula
For a one-sample z-test for a proportion with null hypothesis :
This is the formula sheet's standardized test statistic, (statistic − parameter)/(standard error of the statistic). The standard error uses , because the test assumes is true.
- Right-tailed (): P-value .
- Left-tailed (): P-value .
- Two-sided (): P-value .
The P-value is the probability, assuming is true, of getting a statistic at least as extreme as the one observed, in the direction of . If P-value , reject : there is convincing evidence for . If P-value , fail to reject : there is not convincing evidence for .
Worked example
Problem: A phone company says 60% of its customers would recommend it. A manager suspects the true proportion is higher. In a random sample of 200 customers, 132 would recommend it. Test at .
Step 1: Hypotheses. and , where is the proportion of all the company's customers who would recommend it.
Step 2: Conditions. Random sample; 200 is less than 10% of all customers; and , both at least 10.
Step 3: Test statistic. . , so .
Step 4: P-value. . If 60% of customers really would recommend the company, there is about a 4.2% chance that a random sample of 200 gives a of 0.66 or higher.
Step 5: Conclude. Because , reject . There is convincing evidence that more than 60% of the company's customers would recommend it.
Check it in the simulator: set z to 1.73 with Right and α = 0.05. The P-value reads 0.0418 and the verdict is REJECT. Click α = 0.01: the same P-value now gives FAIL TO REJECT. Click Two-sided: the P-value doubles to 0.0836, which would not be significant at 0.05.
Common mistakes on the AP exam
- "The P-value is the probability that H0 is true." It is calculated assuming is true. It is the probability of data this extreme, not of the hypothesis.
- "Accept H0." A large P-value means the data are consistent with , not that is proven. Say "fail to reject."
- Picking the tail from the data. The direction comes from , stated before you see the results, not from the sign of .
- Forgetting to double for two-sided tests. , not .
- Using in the test's standard error. Tests use ; confidence intervals use .
- Comparing z with α. Compare the P-value with α, or z with a critical value, never z with α.
- A conclusion with no link or context. Write "Because P-value = 0.0418 < α = 0.05, we reject " and then state the evidence about in context.
When the AP exam uses this
P-values are topic 3.6, part of significance tests for a population proportion. Free-response questions regularly ask you to carry out a full test, or to interpret a given P-value in context, which means stating the assumption that is true, the observed result, and the direction of .