Welcome to Hypothesis Testing!
Ever wondered how scientists decide if a new medicine actually works, or how a factory checks if its machines are filling cereal boxes correctly? They use Hypothesis Testing. In this chapter, we transition from just describing data to making big decisions based on it. It’s essentially the mathematical version of a court trial: we assume "innocent until proven guilty." Don't worry if it feels like a lot of new vocabulary at first—once you see the pattern, it becomes one of the most logical parts of Statistics 2!
1. Populations, Censuses, and Samples
Before we can test anything, we need to know where our data comes from.
Key Terms:
Population: The entire collection of items we are interested in (e.g., every student in your school).
Census: When you measure or observe every single member of a population.
Sample: A selection of individual members or items chosen from the population.
Sampling Unit: An individual item within the population that can be sampled (e.g., one student).
Sampling Frame: A complete list of all sampling units (e.g., the school register).
Pros and Cons:
Census:
+ Advantage: It is 100% accurate; it gives a true representation.
- Disadvantage: Very time-consuming, expensive, and difficult to process. You also can't use a census if the testing involves destroying the item (like testing how long a lightbulb lasts!).
Sample:
+ Advantage: Quick, cheap, and easier to manage.
- Disadvantage: It might not be perfectly representative; there is always a chance of "sampling error."
Quick Review: Think of a pot of soup. A census is drinking the whole pot to see if it’s salty. A sample is taking one spoonful. The sampling unit is a spoonful, and the sampling frame is the recipe list of every ingredient in the pot!
2. The Language of Hypothesis Testing
To carry out a test, we need to set the rules of the "trial."
What is a Statistic?
A Statistic is a numerical value calculated only from the data in your sample. It cannot contain any unknown parameters (like the population mean \(\mu\) or probability \(p\)).
The Sampling Distribution of a statistic is the probability distribution of all possible values that the statistic could take from all possible samples of a fixed size.
The Hypotheses
Every test has two competing claims:
1. Null Hypothesis \(H_0\): The "boring" assumption. We assume the situation hasn't changed, or a claim is true. (e.g., "The coin is fair, \(p = 0.5\)").
2. Alternative Hypothesis \(H_1\): The "exciting" claim we are investigating. We only believe this if the evidence against \(H_0\) is very strong. (e.g., "The coin is biased, \(p > 0.5\)").
The Test Statistic and Critical Region
The Test Statistic is the specific result we get from our sample (e.g., "I flipped the coin 10 times and got 9 heads").
The Critical Region is the range of values of the test statistic that would be so unlikely to happen by chance that we would reject \(H_0\).
The Significance Level (usually 5% or 1%) is the "threshold" for how unlikely the result must be. If there is less than a 5% chance of the result happening under \(H_0\), we reject \(H_0\).
Key Takeaway: If your sample result falls in the Critical Region, you say "Goodbye \(H_0\)" and "Hello \(H_1\)."
3. One-Tailed vs. Two-Tailed Tests
This depends on what the question is asking.
One-Tailed Test: You are looking for a change in a specific direction.
Example: "Has the probability of success increased?"
\(H_1: p > \text{value}\) or \(H_1: p < \text{value}\).
The significance level (e.g., 5%) is all at one end of the distribution.
Two-Tailed Test: You are looking for any change, up or down.
Example: "Has the probability changed?"
\(H_1: p \neq \text{value}\).
Important: You must split the significance level in half! For a 5% test, you look for the 2.5% most extreme values at the top AND the 2.5% at the bottom.
Common Mistake: Forgetting to halve the significance level in a two-tailed test. Always check if the question says "changed" (two-tailed) or "increased/decreased" (one-tailed).
4. Testing the Binomial Parameter \(p\)
We use this when we have a fixed number of trials \(n\) and we are testing the probability of success \(p\).
Step-by-Step Process:
1. State \(H_0\) (e.g., \(H_0: p = 0.4\)) and \(H_1\) (e.g., \(H_1: p > 0.4\)).
2. State the distribution under the null hypothesis: \(X \sim B(n, p)\).
3. Determine the significance level (e.g., 5%).
4. Calculate the probability of the observed result or more extreme. For \(H_1: p > k\), calculate \(P(X \geq \text{observed})\).
5. Conclusion: If the probability is less than the significance level, reject \(H_0\). Otherwise, do not reject \(H_0\).
Using Normal Approximation:
If \(n\) is large and \(p\) is close to 0.5, you can use the Normal distribution to approximate the Binomial. Just remember the Continuity Correction!
If \(X \sim B(n, p)\), then \(X \approx N(np, np(1-p))\).
Quick Trick: \(P(X \geq 10)\) in Binomial becomes \(P(Y > 9.5)\) in Normal.
5. Testing the Poisson Mean \(\lambda\)
We use this when we are testing the rate of occurrences over an interval.
Example:
A shop usually gets 10 customers an hour (\(\lambda = 10\)). They run an ad and want to see if the rate has increased. They count 15 customers in one hour.
\(H_0: \lambda = 10\)
\(H_1: \lambda > 10\)
Find \(P(X \geq 15)\) using Poisson tables for \(\lambda = 10\). If this probability is very small (less than your significance level), the ad worked!
Did you know? Hypothesis testing doesn't "prove" anything is 100% certain. It just tells us if the evidence is "strong enough" to be convincing. That's why we always use phrases like "There is sufficient evidence to suggest..."
Summary Checklist
- Define the Variable: Clearly state what \(X\) represents.
- Write Hypotheses: Use symbols (\(p\) or \(\lambda\)).
- Find the Probability: Use tables or your calculator to find the "p-value" (the probability of your result under \(H_0\)).
- Comparison: Compare p-value to the significance level.
- Contextual Conclusion: Always write your final answer in terms of the original problem (e.g., "There is evidence that the machine is faulty").
Don't worry if this seems tricky at first! The more you practice writing out the steps, the more natural it becomes. Keep an eye on those "tails" and always read the question carefully!