Educerie

Educerie · AP · Statistics

AP Statistics 3.6

p-Values

How can a sample of a few hundred people tell us something reliable about thousands, and how sure can we be?

What you will learn

  • Understand that the p-value is the probability, assuming H0 is true, of a result at least as extreme in the direction of Ha
  • Know that the tail follows Ha: right for greater than, left for less than, both for not equal
  • Understand how a simulated null distribution gives a p-value as a proportion
  • Know that a large p-value is not evidence that H0 is true and the p-value is not the probability that H0 is true

You must be able to

  1. Interpret a p-value in context with the assumption that H0 is true
  2. Find a p-value from a z-statistic for each form of Ha
  3. Estimate a p-value from a simulated null distribution
  4. Explain what a small and what a large p-value indicate
  5. Identify wrong readings such as the probability that H0 is true
  6. Double the one-tail area for a two-sided test

In the exam. Section I multiple choice: choose the correct interpretation of a stated p-value, say which tail a p-value comes from, or read a p-value from a simulated distribution. Section II: Question 3 asks for the p-value and often a sentence interpreting it in context. A wrong interpretation (for example, "the probability that the null is true") loses the interpretation mark. Skill: interpret results of inference (4.F).

1The null distribution

Before the data come in, ask: if H0H_0 were true, what would sample proportions look like?

Example (invented). A café chain says 40% of its orders come from its app, and a manager thinks the share is now higher: H0:p=0.40H_0: p = 0.40, Ha:p>0.40H_a: p > 0.40. A random sample of 90 orders is checked.

If H0H_0 is true, then p=0.40p = 0.40 and (3.2) the sample proportion has

μp^=0.40\mu_{\hat{p}} = 0.40σp^=0.40(0.60)90=0.0516the standard deviation under H0\sigma_{\hat{p}} = \sqrt{\frac{0.40(0.60)}{90}} = 0.0516 \qquad \textcolor{#838c91}{\text{the standard deviation under H0}}

Note the 0.40 inside the square root. It is p0p_0, the value in the null hypothesis.

The test statistic puts the sample result on the standard normal scale:

z=p^−p0p0(1−p0)/nhow many standard deviations the sample proportion is from the null valuez = \frac{\hat{p} - p_0}{\sqrt{p_0(1-p_0)/n}} \qquad \textcolor{#838c91}{\text{how many standard deviations the sample proportion is from the null value}}

If H0H_0 is true and the conditions hold, zz has approximately a standard normal distribution. That curve is the null distribution of the test statistic. The p-value is an area under it.

2The p-value is an area, and the tail follows HaH_a

The sample has 45 of 90 orders from the app. So p^=0.50\hat{p} = 0.50.

z=0.50−0.400.0516=1.94the sample proportion is 1.94 standard deviations above 0.40z = \frac{0.50 - 0.40}{0.0516} = 1.94 \qquad \textcolor{#838c91}{\text{the sample proportion is 1.94 standard deviations above 0.40}}

Ha:p>0.40H_a: p > 0.40 points up, so the p-value is the area at or above the observed zz.

p-value=P(z≥1.94)=1−0.9738=0.0262Table A; technology with the unrounded z gives 0.0264p\text{-value} = P(z \ge 1.94) = 1 - 0.9738 = 0.0262 \qquad \textcolor{#838c91}{\text{Table A; technology with the unrounded z gives 0.0264}}

The rule for the tail follows HaH_a:

AlternativeTailp-value
Ha:p>p0H_a: p > p_0upper (right)P(z≥zobs)P(z \ge z_{obs})
Ha:p<p0H_a: p < p_0lower (left)P(z≤zobs)P(z \le z_{obs})
Ha:p≠p0H_a: p \ne p_0bothP(z≤−∣zobs∣)+P(z≥∣zobs∣)P(z \le -\lvert z_{obs}\rvert) + P(z \ge \lvert z_{obs}\rvert)
Figure 1. Three p-values on the standard normal curve, found from the direction of the alternative. Left: Ha has p > p0, the area at or above z = 1.94 is 0.026. Middle: Ha has p < p0, the area at or below z = -1.40 is 0.081. Right: Ha has p not equal to p0, the areas beyond z = -1.94 and z = 1.94 add to 0.053 Ha: p > p₀ −2 0 2 z p-value 0.026 Figure 1. Three p-values on the standard normal curve, found from the direction of the alternative. Left: Ha has p > p0, the area at or above z = 1.94 is 0.026. Middle: Ha has p < p0, the area at or below z = -1.40 is 0.081. Right: Ha has p not equal to p0, the areas beyond z = -1.94 and z = 1.94 add to 0.053 Ha: p < p₀ −2 0 2 z p-value 0.081 Figure 1. Three p-values on the standard normal curve, found from the direction of the alternative. Left: Ha has p > p0, the area at or above z = 1.94 is 0.026. Middle: Ha has p < p0, the area at or below z = -1.40 is 0.081. Right: Ha has p not equal to p0, the areas beyond z = -1.94 and z = 1.94 add to 0.053 Ha: p ≠ p₀ −2 0 2 z p-value 0.053
Figure 1 · Three p-values: the area to the right, to the left, or in both tails of the null distribution

Figure 1 shows all three. The first panel is the café example, with the area to the right of z=1.94z = 1.94. The second panel shows a left tail for a different result, z=−1.40z = -1.40, which has an area of 0.081. The third shows both tails: with z=1.94z = 1.94 the two areas add to 0.053.

For a two-sided test, double the one-tail area when the curve is symmetric. For the same z=1.94z = 1.94:

p-value=2×0.0262=0.0524to three decimals, 0.053 with the unrounded zp\text{-value} = 2 \times 0.0262 = 0.0524 \qquad \textcolor{#838c91}{\text{to three decimals, 0.053 with the unrounded z}}

A two-sided p-value is always larger than the matching one-sided p-value. A two-sided test needs more evidence, because it also counts the other direction.

3A simulated null distribution

The normal curve is a model. You can also build the null distribution by simulation. The p-value is then the proportion of simulated results that are as extreme as the observed one, or more.

Simulation for the café: use a random-number device to draw 10,000 samples of 90 orders from a population in which exactly 40% of orders are from the app. Record each sample proportion.

  • HaH_a is "greater than", so count the simulated proportions that are 0.50 or more.
  • In one such simulation, 323 of the 10,000 are at or above 0.50.
p-value≈32310000=0.0323the proportion at or above the observed valuep\text{-value} \approx \frac{323}{10000} = 0.0323 \qquad \textcolor{#838c91}{\text{the proportion at or above the observed value}}

That is close to the normal-model value of 0.026. Different simulations give slightly different numbers. For the other alternatives:

  • Ha:p<p0H_a: p < p_0: the proportion of simulated values at or below the observed one.
  • Ha:p≠p0H_a: p \ne p_0: the proportion at least as far from p0p_0 in either direction, counting both ends.

On the exam, a simulated p-value is read from a dotplot or a count. Say which tail you counted and give the proportion.

4Interpreting the p-value

A p-value interpretation has three parts, and it needs the assumption that H0H_0 is true.

Assuming the true proportion of all the chain's orders placed through the app is 0.40, the probability of getting a sample proportion of 0.50 or higher in a random sample of 90 orders is 0.026.

Check it for three things:

  1. "Assuming H0H_0." The null value is stated, in context: "assuming the true proportion of …\ldots is 0.40".
  2. The result and its direction. "A sample proportion of 0.50 or higher", with "or higher" matching HaH_a.
  3. The probability. The number, with the sample size and the sampling method in the sentence.

A shorter template: "If H0H_0 were true, the probability of getting a sample result at least as extreme as ours, by chance alone, is ___\_\_\_." Put the context into each blank.

5What size means

  • A small p-value means the observed result would be unusual if H0H_0 were true. That provides evidence for HaH_a. The smaller the p-value, the more convincing the evidence.
  • A large p-value means the observed result would not be unusual if H0H_0 were true. That is not convincing evidence for HaH_a.

A large p-value does not provide evidence that H0H_0 is true. It means the data are consistent with H0H_0. They are also consistent with many other values. "No evidence of a difference" and "evidence of no difference" are different statements.

The line between small and large is the significance level. Topic 3.7 puts the p-value next to α\alpha and makes the decision.

6What a p-value is not

Memorise these wrong readings.

  • Not the probability that H0H_0 is true. H0H_0 is a statement about a fixed parameter. It is true or false. The p-value assumes H0H_0 and then asks how surprising the data are.
  • Not the probability that the results happened "by chance". It is a conditional probability, given H0H_0.
  • Not the probability that HaH_a is true.
  • Not the probability of the exact observed value. It is the probability of that value or one more extreme.
  • Not a measure of how big or important the difference is. A large sample can give a tiny p-value for a tiny difference.

Practice questions

30 questions on this note, from easy to hard. Each one you get right lights a star of this topic's constellation.