Basic Ideas and Steps of Hypothesis Testing
Definition of Hypothesis Testing
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
Hypothesis testing is an important branch of statistical inference; it uses sample information to decide whether a certain hypothesis about the population parameters holds. Its basic idea is: under the condition that a certain hypothesis holds, the probability of observing the sample values is very small; if the sample values actually observed are indeed small, then the correctness of the null hypothesis is in doubt.
Intuitive Understanding of Hypothesis Testing
Understanding: hypothesis testing is similar to a court trial, where the null hypothesis corresponds to the presumption of innocence and the alternative hypothesis corresponds to the charge of guilt. We use evidence (sample data) to decide whether to reject the null hypothesis.
Basic Elements of Hypothesis Testing
Null hypothesis : usually the hypothesis we want to reject, expressing “no difference”, “no effect”, and so on Alternative hypothesis : usually the hypothesis we want to accept, expressing “there is a difference”, “there is an effect”, and so on Significance level : the probability of committing a Type I error, usually taken as 0.05 or 0.01 Test statistic: the statistic used to decide whether to reject the null hypothesis Rejection region: the region of values of the test statistic; the null hypothesis is rejected when the statistic falls in this region
Step 1: State the Hypotheses
Null hypothesis : or or Alternative hypothesis : or or
Example 1: testing whether the population mean equals a certain value
Step 2: Choose the Test Statistic
Principles of choice:
- Under the condition that the null hypothesis holds, the distribution of the test statistic is known
- The test statistic can distinguish the null hypothesis from the alternative hypothesis
- The computation of the test statistic is relatively simple
Example 2: for testing the mean of a normal population (with the variance known)
- Test statistic:
Step 3: Determine the Rejection Region
Two-sided test: One-sided test: or
Example 3: for a two-sided test with significance level
- Rejection region:
Step 4: Compute the Sample Value
Computation: substitute the sample data into the test statistic to obtain a concrete numerical value.
Example 4: the sample mean is , the population standard deviation is , the sample size is , and we test
Step 5: Draw a Conclusion
Decision: if the value of the test statistic falls inside the rejection region, then reject the null hypothesis; otherwise accept the null hypothesis.
Example 5: for Example 4, , so the null hypothesis is not rejected.
Type I Error (False Rejection)
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
The error of rejecting when the null hypothesis is true.
Probability:
Significance: a Type I error is the error of “wrongly convicting an innocent person”; its probability is exactly the significance level .
Example 6: in Example 4, if (the null hypothesis is true) but , then a Type I error has been committed.
Type II Error (False Acceptance)
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
The error of accepting when the null hypothesis is false.
Probability:
Significance: a Type II error is the error of “letting a guilty person go”.
Example 7: in Example 4, if (the null hypothesis is false) but , then a Type II error has been committed.
Relation Between the Two Types of Errors
Relation: with the sample size fixed, decreasing increases , and decreasing increases .
Trade-off: the probability of the Type I error is usually controlled first, because the consequences of a Type I error are usually more serious.
Power Function
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
The power function gives the probability of rejecting the null hypothesis when the null hypothesis is false.
Significance: the larger the power function, the better the test performs.
Significance Level
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
The significance level is the maximum probability of committing a Type I error.
Common values: (5%), (1%), (10%)
Choice: choose the significance level according to how serious the problem is and what its consequences are.
P-Value
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
The P-value is the probability, under the condition that the null hypothesis is true, that the test statistic takes a value more extreme than the observed value.
Computation:
- Two-sided test:
- One-sided test: or
Decision: if , then reject the null hypothesis; otherwise accept the null hypothesis.
Example 8: for Example 4, , , so the null hypothesis is not rejected.
Two-Sided Test
Form: ,
Rejection region:
Application: used when we care whether the parameter equals a certain value.
One-Sided Test
Left one-sided test: , Right one-sided test: ,
Rejection region: or
Application: used when we care whether the parameter is greater than or less than a certain value.
Critical Value Method
Steps:
- Determine the critical value from the significance level
- Compute the value of the test statistic
- Compare the test statistic with the critical value
- Make a decision
Advantages: intuitive and explicit Disadvantages: requires consulting tables
P-Value Method
Steps:
- Compute the P-value
- Compare the P-value with the significance level
- Make a decision
Advantages: no need to consult tables, allows precise judgement Disadvantages: relatively more complex to compute
Influence of the Sample Size
Influence: the larger the sample size, the higher the power of the test and the smaller the probability of committing a Type II error.
Reason: the larger the sample size, the more accurate the estimate, and the more easily real differences are detected.
Effect Size
Definition
A definition is a precise description of what a concept, a term, or an object means. Understanding definitions is the foundation of learning any field, and every concept has its own exact meaning.
The effect size is an indicator that measures the magnitude of an actual difference.
Significance: even if the result is statistically significant, a small effect size may mean little practical significance.
Multiple Comparisons
Problem: when performing several hypothesis tests, the probability of committing a Type I error increases.
Solution: use a multiple comparison correction method, such as the Bonferroni correction.
Applications in Quality Control
Application 1: testing whether product quality meets a standard Application 2: testing whether the production process is stable
Applications in Medical Research
Application 3: testing whether a new drug is effective Application 4: testing whether treatment methods differ
Applications in the Social Sciences
Application 5: testing whether survey results differ Application 6: testing whether the effect of a policy is significant
Exercise 1
Briefly describe the general steps of hypothesis testing.
Approach: List the five basic steps of hypothesis testing.
Steps:
- State the hypotheses: determine the null hypothesis and the alternative hypothesis
- Choose the statistic: select an appropriate test statistic
- Determine the rejection region: determine the rejection region from the significance level
- Compute the sample value: substitute the sample data into the test statistic
- Draw a conclusion: make a decision based on the value of the test statistic
Answer: state the hypotheses → choose the statistic → determine the rejection region → compute the sample value → draw a conclusion
Exercise 2
Let with known. To test , write the test statistic.
Approach: Use the test statistic of the normal distribution.
Steps:
- Test statistic:
- Under the condition that the null hypothesis holds,
Answer:
Exercise 3
Explain the meaning of the Type I error and the Type II error.
Approach: Explain the definitions and meanings of the two types of errors.
Steps:
- Type I error: the error of rejecting when the null hypothesis is true
- Type II error: the error of accepting when the null hypothesis is false
- Probability of a Type I error: , that is, the significance level
- Probability of a Type II error:
Answer: a Type I error is a false rejection, and a Type II error is a false acceptance
Exercise 4
Let the significance level be and the P-value be . Should the null hypothesis be rejected or accepted?
Approach: Compare the P-value with the significance level.
Steps:
- By the P-value method, the null hypothesis is rejected when
- Therefore the null hypothesis should be rejected
Answer: reject the null hypothesis
Exercise 5
Let the test statistic be and the significance level be . For a two-sided test, should the null hypothesis be rejected or accepted?
Approach: Compare the test statistic with the critical value.
Steps:
- The critical value of the two-sided test:
- The test statistic falls inside the rejection region
- Therefore the null hypothesis should be rejected
Answer: reject the null hypothesis
Symbols Used in This Article
| Greek Letter | Pronunciation | Description |
|---|---|---|
| Alpha (alpha) | denotes the significance level, that is, the probability of committing a Type I error | |
| Beta (beta) | denotes the probability of committing a Type II error |
