Educerie

Educerie · AP · Statistics

AP Statistics 3.8

Potential Errors When Performing Tests

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 a Type I error rejects a true H0 and a Type II error fails to reject a false H0
  • Know that P(Type I) is alpha and P(Type II) is 1 minus the power
  • Understand that power rises with a larger sample, a smaller standard error, a true value farther from H0 or a larger alpha
  • Know that the consequences of each error guide the choice of alpha and of the sample size

You must be able to

  1. Describe a Type I and a Type II error in the context of a study
  2. State the probability of each type of error from alpha or the power
  3. Explain what changes the power of a test
  4. Describe the consequences of each error and say which matters more
  5. Calculate a power from a rejection cut-off and a true value
  6. Explain the trade-off between alpha and the Type II probability

In the exam. Section I multiple choice: state a Type I or Type II error in the context of a study, say which probability is α\alpha, find a Type II probability from a given power, or say what happens to power when a sample size or significance level changes. Section II: a part of an inference or multi-focus question asks for an error and its consequence in context. Skills: identify types of errors (2.D), calculate probabilities (3.C), interpret (4.D).

1Four possible outcomes

There are two decisions and two possible truths. That makes four outcomes.

H0H_0 is trueHaH_a is true (H0H_0 false)
Reject H0H_0 (convincing evidence for HaH_a)Type I errorCorrect decision (this is power)
Fail to reject H0H_0 (no convincing evidence for HaH_a)Correct decisionType II error

You never learn which column you are in. The errors describe what might have happened.

In the words of the topic:

  • A Type I error occurs when there is convincing statistical evidence that HaH_a is true (because the p-value is small), but it is not true.
  • A Type II error occurs when there is not convincing statistical evidence that HaH_a is true (because the p-value is large), but it is true.

The power of a test is the probability that it correctly rejects a false null hypothesis.

2Describe the errors in context

An exam answer must say what the error is in the situation, not in the abstract. Build the sentence from H0H_0 and HaH_a.

Example. The clinic from 3.7 tests H0:p=0.15H_0: p = 0.15 against Ha:p<0.15H_a: p < 0.15, where pp is the proportion of all its patients who miss an appointment after reminder texts begin.

  • Type I error. The clinic concludes there is convincing evidence that the proportion of patients who miss an appointment is less than 0.15, when in fact it is 0.15 (the reminder texts made no difference).
  • Type II error. The clinic concludes there is not convincing evidence that the proportion is less than 0.15, when in fact it is less than 0.15 (the reminder texts did help).

Use this recipe:

  1. Take the conclusion that matches the wrong decision.
  2. Add "when in fact" and the other truth.
  3. Keep the population and the parameter in the sentence.

For a Type I error the decision is "convincing evidence for HaH_a" and the truth is H0H_0. For a Type II error the decision is "not convincing evidence for HaH_a" and the truth is HaH_a.

3The probabilities

Type I. The probability of a Type I error is the significance level:

P(Type I error)=αit is set before the data are collected, often 0.05P(\text{Type I error}) = \alpha \qquad \textcolor{#838c91}{\text{it is set before the data are collected, often 0.05}}

When the null is true, a test at α=0.05\alpha = 0.05 rejects in about 5% of samples. This is the price of using a cut-off.

Type II. The probability of a Type II error is written β\beta and equals one minus the power:

P(Type II error)=1−powerpower = P(reject H0 when Ha is true)P(\text{Type II error}) = 1 - \text{power} \qquad \textcolor{#838c91}{\text{power = P(reject H0 when Ha is true)}}

The power depends on the specific value of pp that is true. A test has high power against a far-away alternative and low power against a close one. So a Type II probability is always stated for a particular true value.

The probability of a Type II error should ideally be small, so the power should be large. A common target is power of at least 0.80, a Type II probability of at most 0.20.

4Finding the power

On the exam you are usually told the power or the Type II probability, and asked to use it. But the idea is worth following once.

Example (invented). A phone app's company says that 50% of new users complete setup. A designer changes the first screen and tests H0:p=0.50H_0: p = 0.50 against Ha:p>0.50H_a: p > 0.50 with n=100n = 100 new users, at α=0.05\alpha = 0.05. What is the power if the true proportion is 0.60?

Step 1. Find the rejection cut-off. Under H0H_0 the standard deviation of p^\hat{p} is 0.50(0.50)/100=0.05\sqrt{0.50(0.50)/100} = 0.05. The test rejects when z≥1.645z \ge 1.645, that is when

p^≥0.50+1.645(0.05)=0.582the smallest sample proportion that leads to rejecting H0\hat{p} \ge 0.50 + 1.645(0.05) = 0.582 \qquad \textcolor{#838c91}{\text{the smallest sample proportion that leads to rejecting H0}}

Step 2. Find the chance of being above the cut-off when p=0.60p = 0.60. If the true proportion is 0.60, the standard deviation of p^\hat{p} is 0.60(0.40)/100=0.049\sqrt{0.60(0.40)/100} = 0.049.

z=0.582−0.600.049=−0.36z = \frac{0.582 - 0.60}{0.049} = -0.36power=P(p^≥0.582)=P(z≥−0.36)=0.64\text{power} = P(\hat{p} \ge 0.582) = P(z \ge -0.36) = 0.64

Step 3. The probability of a Type II error is 1−0.64=0.361 - 0.64 = 0.36.

Figure 1. Two sampling distributions of the sample proportion, for n = 100. Left curve: H0 true, p = 0.50. Right curve: the alternative p = 0.60 is true. The test rejects H0 when the sample proportion is above 0.582. The area of the left curve beyond 0.582 is alpha (0.05, a Type I error); the area of the right curve below 0.582 is the Type II error probability (0.36); the rest of the right curve is the power (0.64) 0.4 0.5 0.6 0.7 sample proportion H₀ true p = 0.60 Type II error 0.36 α = 0.05
Figure 1 · The null curve (gray) and the curve for a true proportion of 0.60 (teal), with the rejection cut-off at 0.582

Figure 1 shows the two sampling distributions. The gray curve is the world where H0H_0 is true. The teal curve is the world where p=0.60p = 0.60.

  • The dashed line at 0.582 is the cut-off. Sample proportions to its right lead to rejection.
  • The clay area, the part of the gray curve to the right of the line, is α=0.05\alpha = 0.05: the chance of rejecting when H0H_0 is true. That is the Type I error.
  • The amber area, the part of the teal curve to the left of the line, is the chance of failing to reject when p=0.60p = 0.60. That is the Type II error, 0.36.
  • The teal area to the right of the line is the power, 0.64.

5What affects the power

Power increases when any one of these happens and the others stay the same.

  1. The sample size increases.
  2. The standard error decreases. A larger nn does this.
  3. The true parameter value is farther from the null value.
  4. The significance level α\alpha increases.

The example above, with the true proportion 0.60, shows each one.

ChangePower
n=100n = 100, α=0.05\alpha = 0.05, p=0.60p = 0.60 (the example)0.64
n=200n = 2000.89
n=400n = 4000.99
α=0.01\alpha = 0.01 (with n=100n = 100)0.37
α=0.10\alpha = 0.10 (with n=100n = 100)0.77
True proportion 0.55 (with n=100n = 100, α=0.05\alpha = 0.05)0.26
True proportion 0.70 (with n=100n = 100, α=0.05\alpha = 0.05)0.99

Why each one works:

  • A bigger sample squeezes both curves, so they overlap less. The two worlds are easier to tell apart.
  • A farther true value moves the teal curve away from the gray one, so more of it lies beyond the cut-off.
  • A bigger α\alpha moves the cut-off toward the null, so more of the teal curve lies beyond it.

The last point is a trade-off. Raising α\alpha lowers the Type II probability and raises the Type I probability. You cannot reduce both with the sample size fixed. The way to reduce both is to take a larger sample.

6Consequences decide the choices

Sometimes a Type I error is more serious. Sometimes a Type II error is.

Example 1. A hospital tests whether a new, expensive and risky treatment is better than the standard one. A Type I error means adopting a risky treatment that does not help. That is serious, so use a small α\alpha, such as 0.01.

Example 2. A health agency screens drinking water for a harmful contaminant. H0H_0: the proportion of samples over the safe limit is acceptable. A Type II error means failing to detect a real problem and leaving people exposed. That is serious, so the study should have high power, which means a large sample size.

The rule of thumb:

  • The consequences of a Type I error influence the choice of the significance level α\alpha.
  • The consequences of a Type II error influence how large the sample should be.

These consequences should be considered before the study, not after.

Practice questions

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