1. Home
  2. Explore
  3. Statistics
  4. Hypothesis Testing Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Hypothesis Testing Overview

Hypothesis Testing

Introduction to Hypothesis Testing

Hypothesis testing is generally considered more difficult than confidence intervals. Confidence intervals primarily involve performing a calculation and interpreting the result, but hypothesis testing requires a structured decision-making process with multiple steps. The conceptual framework and the logic behind rejecting or failing to reject a claim demand careful attention.

The process can be introduced with a concrete example. Suppose a person claims to be a 40% free throw shooter. An observer believes the shooter is actually worse — a 20% shooter. The goal is to design a test to decide which claim is more plausible based on evidence.

Null and Alternative Hypotheses

In hypothesis testing, two competing statements are set up:

  • Null hypothesis (H0H_0H0​) : The statement that is assumed true until evidence suggests otherwise. It often represents the status quo or a skeptical viewpoint. In the free throw example, the null hypothesis is that the shooter's true probability of success ppp (making a free throw) is 0.2, or possibly less: H0:p≤0.2H_0: p \leq 0.2H0​:p≤0.2.

  • Alternative hypothesis (H1H_1H1​) : The statement that the researcher hopes to support. Here, the alternative is H1:p>0.2H_1: p > 0.2H1​:p>0.2 (the shooter believes they are better than 20%).

The parameter ppp is the true probability of success on any single attempt. The null hypothesis is often written as H0:p=0.2H_0: p = 0.2H0​:p=0.2 for computational purposes — this turns a composite hypothesis (an inequality) into a simple hypothesis (a single value). This simplification is justified because the probability of making a Type 1 error is maximized when ppp is exactly at the boundary value (0.2); if the true ppp is smaller, the chance of falsely rejecting H0H_0H0​ is even lower.

Definition: Null hypothesis (H0H_0H0​) — the hypothesis to be tested, assumed true unless strong evidence contradicts it. Alternative hypothesis (H1H_1H1​) — the hypothesis that is accepted if the null is rejected. Notation varies; some sources use HaH_aHa​ for the alternative.

The Testing Framework

To perform the test, a random sample of free throws is taken. Let the sample size be n=20n = 20n=20, a manageable number. Let XXX be the number of successes (makes) in 20 attempts.

  • XXX is a binomial random variable with parameters n=20n=20n=20 and unknown probability ppp.

  • Under the null hypothesis (assuming p=0.2p=0.2p=0.2), the expected number of successes is 20×0.2=420 \times 0.2 = 420×0.2=4.

  • If the observed number of successes is low (e.g., 4 or fewer), that supports the null. If it is high (e.g., 8 or more), that supports the alternative. The challenge is to determine how many successes constitute strong enough evidence to reject H0H_0H0​.

Types of Errors

Two kinds of mistakes can occur when making a decision:

  • Type 1 error: Rejecting H0H_0H0​ when it is actually true. This is analogous to convicting an innocent person in a courtroom.

  • Type 2 error: Failing to reject H0H_0H0​ when it is false. This is analogous to acquitting a guilty person.

The probability of a Type 1 error is denoted by α\alphaα (the level of significance). The probability of a Type 2 error is denoted by β\betaβ. There is a trade-off: making α\alphaα smaller (harder to commit a Type 1 error) typically increases β\betaβ (easier to commit a Type 2 error). The only way to reduce both errors simultaneously is to increase the sample size.

Key takeaway: A smaller α\alphaα makes it harder to reject H0H_0H0​, protecting against false positives, but may allow false negatives. The choice of α\alphaα depends on the consequences of each error.

Classical Approach (Critical Region)

The classical approach, developed decades ago, involves setting a level of significance α\alphaα before the experiment and defining a critical region (or rejection region) — the set of values of the test statistic that lead to rejecting H0H_0H0​.

Steps in the Classical Approach

  1. Set up the hypotheses: H0:p≤0.2H_0: p \leq 0.2H0​:p≤0.2 (treated as p=0.2p=0.2p=0.2), H1:p>0.2H_1: p > 0.2H1​:p>0.2.

  2. Choose the level of significance α\alphaα. A common choice is 0.05 (5%), but any value can be used depending on the consequences of a Type 1 error. For matters of life and death, α\alphaα might be set extremely small (e.g., 0.0001).

  3. Determine the critical region. Find the smallest number of successes kkk such that P(X≥k∣p=0.2)≈αP(X \geq k \mid p=0.2) \approx \alphaP(X≥k∣p=0.2)≈α.

  4. Conduct the experiment — shoot 20 free throws and record XXX.

  5. Make a decision: if XXX falls in the critical region, reject H0H_0H0​; otherwise, fail to reject H0H_0H0​.

Finding the Critical Region for the Free Throw Example

With n=20n=20n=20 and p=0.2p=0.2p=0.2 under H0H_0H0​, compute P(X≥k)P(X \geq k)P(X≥k) for various kkk using the binomial distribution.

  • P(X≥7)=1−P(X≤6)P(X \geq 7) = 1 - P(X \leq 6)P(X≥7)=1−P(X≤6). Using a binomial CDF:

    1−BinomCDF(20,0.2,6)=1−0.9133=0.08671 - \text{BinomCDF}(20, 0.2, 6) = 1 - 0.9133 = 0.08671−BinomCDF(20,0.2,6)=1−0.9133=0.0867

    This is above 0.05.

  • P(X≥8)=1−P(X≤7)=1−0.9679=0.0321P(X \geq 8) = 1 - P(X \leq 7) = 1 - 0.9679 = 0.0321P(X≥8)=1−P(X≤7)=1−0.9679=0.0321 This is below 0.05.

Since XXX is discrete, there is no kkk that gives exactly 0.05. The safe choice is to use k=8k=8k=8, so the critical region is {8,9,10,…,20}\{8, 9, 10, \dots, 20\}{8,9,10,…,20}. The actual probability of a Type 1 error is then 0.0321, slightly less than the chosen α\alphaα of 0.05.

Decision rule: If the shooter makes 8 or more free throws out of 20, reject H0H_0H0​ (conclude p>0.2p > 0.2p>0.2). Otherwise, fail to reject H0H_0H0​.

Note: The critical region is determined by assuming the null hypothesis is true (using p=0.2p=0.2p=0.2) and ensuring the probability of incorrectly rejecting H0H_0H0​ is at most α\alphaα.

Modern Approach (p-value)

The modern approach, which has become common in the last several decades, computes a p-value and then makes a decision by comparing the p-value to the chosen α\alphaα.

Definition of p-value

p-value: The probability, assuming the null hypothesis is true, of observing a test statistic value as extreme as, or more extreme than, the value actually observed. "More extreme" is defined in the direction of the alternative hypothesis.

For the free throw example, if the shooter makes 6 out of 20, the p-value is:

p-value=P(X≥6∣p=0.2)\text{p-value} = P(X \geq 6 \mid p = 0.2)p-value=P(X≥6∣p=0.2)

Using the binomial distribution:

P(X≥6)=1−P(X≤5)=1−0.8042=0.1958P(X \geq 6) = 1 - P(X \leq 5) = 1 - 0.8042 = 0.1958P(X≥6)=1−P(X≤5)=1−0.8042=0.1958

So the p-value is approximately 0.196.

Decision Using p-value

If the p-value is less than the chosen level of significance α\alphaα, reject H0H_0H0​. If it is greater than or equal to α\alphaα, fail to reject H0H_0H0​.

  • With α=0.05\alpha = 0.05α=0.05, the p-value of 0.196 is larger than 0.05, so we fail to reject H0H_0H0​. This does not mean H0H_0H0​ is accepted; it simply means there is insufficient evidence to conclude that p>0.2p > 0.2p>0.2.

  • If the shooter had made 8 out of 20, the p-value would be P(X≥8)=0.0321P(X \geq 8) = 0.0321P(X≥8)=0.0321, which is less than 0.05, leading to rejection of H0H_0H0​.

Common Misinterpretation

The p-value is not the probability that the null hypothesis is true. That probability cannot be determined using classical hypothesis testing. The p-value is a conditional probability under the assumption that H0H_0H0​ is true — it measures how unusual the observed result would be if H0H_0H0​ were true.

Crucial distinction: A small p-value indicates that the observed data are unlikely under H0H_0H0​, which casts doubt on H0H_0H0​, but it does not quantify the probability that H0H_0H0​ is true.

Terminology and Comparison

  • Classical approach (critical region): The decision rule is determined before the experiment based on α\alphaα. It leads to a clear "reject" or "fail to reject" outcome.

  • Significance testing (p-value approach): The p-value is computed after the experiment, and the decision is made by comparing it to α\alphaα. This approach is sometimes called significance testing because it asks whether the result is statistically significant at a given level (e.g., "significant at the 5% level").

  • Statistical significance: A result is said to be statistically significant at level α\alphaα if the p-value is less than α\alphaα.

Both approaches incorporate the idea of controlling the Type 1 error rate. In practice, the p-value approach is more flexible because it provides a measure of evidence that can be interpreted at any α\alphaα.

Practical Considerations

Hypothesis testing is not purely theoretical; the decision to reject or fail to reject H0H_0H0​ often leads to real-world actions (e.g., investing in a new marketing campaign, approving a drug, or concluding that a process improvement is effective). The consequences of Type 1 and Type 2 errors should guide the choice of α\alphaα and the interpretation of results.

To extend these ideas to testing means (rather than proportions), a ttt-statistic is often used, as described in sections 84 and 85 of the textbook. The logic remains the same: set up hypotheses, choose α\alphaα, compute a test statistic, find the p-value (or critical region), and make a decision. The distribution changes from binomial to normal or ttt, but the fundamental reasoning is identical.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent