Hypothesis Testing for Two Normal Populations
When the Variances Are Known (Z Test)
Population: , , with known
Hypotheses:
- (two-sided test)
- (right one-sided test)
- (left one-sided test)
Test statistic:
Rejection region:
- Two-sided test:
- Right one-sided test:
- Left one-sided test:
Example 1: a factory produces parts with two different processes. The lengths of the parts produced by process A follow , and the lengths of the parts produced by process B follow . 16 parts are drawn from process A with an average length of 10.2cm, and 20 parts are drawn from process B with an average length of 10.0cm. At the significance level , test whether the part lengths produced by the two processes differ.
Solution:
- State the hypotheses: ,
- Test statistic:
- Rejection region:
- Decision: , so reject the null hypothesis
- Conclusion: the part lengths produced by the two processes differ significantly
When the Variances Are Unknown but Equal (Two-Sample T Test)
Population: , , with unknown but equal
Hypotheses:
- (two-sided test)
- (right one-sided test)
- (left one-sided test)
Test statistic:
where is the pooled variance.
Rejection region:
- Two-sided test:
- Right one-sided test:
- Left one-sided test:
Example 2: a hospital compares the effects of two drugs on high blood pressure. 15 patients are treated with drug A, with an average blood pressure reduction of 8.5mmHg and a sample standard deviation of 2.1mmHg; 12 patients are treated with drug B, with an average blood pressure reduction of 6.8mmHg and a sample standard deviation of 2.3mmHg. At the significance level , test whether the effects of the two drugs differ.
Solution:
- State the hypotheses: ,
- Pooled variance:
- Test statistic:
- Rejection region:
- Decision: , so the null hypothesis is not rejected
- Conclusion: there is no significant difference between the effects of the two drugs
When the Variances Are Unknown and Unequal (Welch’s T Test)
Population: , , with unknown and unequal
Hypotheses:
- (two-sided test)
- (right one-sided test)
- (left one-sided test)
Test statistic:
where the degrees of freedom are (the Welch-Satterthwaite formula).
Rejection region:
- Two-sided test:
- Right one-sided test:
- Left one-sided test:
When the Means Are Unknown
Population: , , with unknown
Hypotheses:
- (two-sided test)
- (right one-sided test)
- (left one-sided test)
Test statistic:
Rejection region:
- Two-sided test: or
- Right one-sided test:
- Left one-sided test:
Example 3: a factory compares the stability of two production processes. 10 products are produced with process A, with a sample variance of 0.04; 12 products are produced with process B, with a sample variance of 0.06. At the significance level , test whether the stability of the two processes differs.
Solution:
- State the hypotheses: ,
- Test statistic:
- Rejection region: or
- Decision: , so the null hypothesis is not rejected
- Conclusion: there is no significant difference between the stability of the two processes
Comparison of Methods for Testing a Difference of Means
Z test:
- Applicable condition: the variances are known
- Advantages: simple to compute, no need to consult the t distribution table
- Disadvantages: requires knowing the population variance
Two-sample T test:
- Applicable condition: the variances are unknown but equal
- Advantages: does not require knowing the population variance
- Disadvantages: requires assuming the variances are equal
Welch’s T test:
- Applicable condition: the variances are unknown and unequal
- Advantages: does not require assuming the variances are equal
- Disadvantages: relatively more complex to compute
Characteristics of the Test for the Ratio of Variances
F test:
- Object of the test: the ratio of the variances of two normal populations
- Application scenarios: comparing the precision and the stability of two methods
- Cautions: it is sensitive to the normality assumption
The Normality Assumption
Importance: all the testing methods are based on the normality assumption.
Testing methods:
- Graphical methods: Q-Q plots, histograms
- Statistical tests: the Shapiro-Wilk test, the Kolmogorov-Smirnov test
Handling non-normal data:
- Data transformation: logarithmic transformation, square root transformation, and so on
- Nonparametric tests: the Mann-Whitney U test, the Kruskal-Wallis test, and so on
The Independence Assumption
Importance: the sample observations should be mutually independent.
Testing methods:
- Time series analysis: the autocorrelation function
- Spatial data analysis: spatial autocorrelation
The Homogeneity of Variance Assumption
Importance: the two-sample T test requires the assumption of equal variances.
Testing methods:
- F test: tests the ratio of variances
- Levene’s test: a test for homogeneity of variance that is insensitive to normality
- Brown-Forsythe test: a test for homogeneity of variance based on the median
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.
Factors that influence it:
- Sample size: the larger the sample size, the higher the power
- Significance level: the higher the significance level, the higher the power
- Effect size: the larger the effect size, the higher the power
Determining the Sample Size
Problem: given the significance level, the power, and the effect size, determine the sample size required.
Example 4: for testing the difference of the means of two normal populations, given the significance level , the power , and the effect size , find the sample size for each group.
Solution:
- Use the power analysis formula
- Consult the table or use software to compute
- We obtain for each group
The Multiple Comparison Problem
Problem: when performing several hypothesis tests, the probability of committing a Type I error increases.
Solution:
- Bonferroni correction: divide the significance level by the number of tests
- Holm correction: adjust the significance level step by step
- FDR control: control the false discovery rate
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.
Common effect sizes:
- Cohen’s d:
- Correlation coefficient:
Significance: even if the result is statistically significant, a small effect size may mean little practical significance.
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.
Exercise 1
For two normal populations whose variances are unknown but equal, which test should be used to test the difference of the means?
Approach: Choose the appropriate test method according to the testing conditions.
Steps:
- Test the difference of the means of two normal populations
- The variances are unknown but equal
- Use the two-sample T test
- Test statistic:
Answer: the two-sample T test
Exercise 2
Let the variances of two populations be . To test , which test should be used?
Approach: Choose the appropriate test method according to the object being tested.
Steps:
- Test the ratio of the variances of two normal populations
- Use the F test
- Test statistic:
Answer: the F test
Exercise 3
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 4
Let , with unknown but equal. To test , write the test statistic.
Approach: Use the test statistic of the t distribution.
Steps:
- Test statistic:
- Under the condition that the null hypothesis holds,
- where
Answer:
Exercise 5
Let , with unknown. To test , write the test statistic.
Approach: Use the test statistic of the F distribution.
Steps:
- Test statistic:
- Under the condition that the null hypothesis holds,
Answer:
