Title | Chapter 3 - Hypothesis Testing (students\' notes) |
---|---|
Course | Statistics For Science And Engineering |
Institution | Universiti Teknologi MARA |
Pages | 17 |
File Size | 511.1 KB |
File Type | |
Total Downloads | 492 |
Total Views | 960 |
STA408: Statistics for Science and EngineeringChapter 3: Hypothesis TestingIntroduction A person who has indicted for committing a crime and is being tried in a court. Based on the available evidence, the judge or jury will make one of the two possible decisions: The person is not guilty The per...
STA408: Statistics for Science and Engineering
Chapter 3: Hypothesis Testing Introduction A person who has indicted for committing a crime and is being tried in a court. Based on the available evidence, the judge or jury will make one of the two possible decisions: The person is not guilty The person is guilty At the outset of the trial the person is presumed not guilty. The prosecutor’s efforts are to prove (gather evidence) that the person has committed the crime, and hence, guilty. Two Hypotheses In statistics Null hypothesis, 𝐻0 : The person is not guilty. Alternative hypothesis, 𝐻1 : The person is guilty. Null hypothesis: is usually the hypothesis that is assumed to be true to begin with states that a given claim (or statement) about a population parameter is true. Definitions A statistical hypothesis is a conjecture about a population parameter. This conjecture may or may not be true. A null hypothesis is a claim (or statement) about a population parameter that is assumed to be true until it is declared false. An alternative hypothesis is a claim about a population parameter that will be true if the null hypothesis is false. Rejection and non-rejection regions
Four possible outcomes of a test of hypothesis Actual Situation
Decision
Do not reject 𝐻0 Reject 𝐻0
𝑯𝟎 is true
Correct decision
Type I or 𝛼 error
𝑯𝟎 is false
Type II or 𝛽 error Correct decision
STA408
Chapter 3: Hypothesis Testing
Two types of errors A Type I error occurs when a true null hypothesis is rejected. 𝛼 = 𝑃(𝐻0 is rejected | 𝐻0 is true) The value of 𝛼 represents the significance level of the test.
A Type II error occurs when a false null hypothesis is not rejected. 𝛽 = 𝑃(𝐻0 is not rejected | 𝐻0 is false) The value of 𝛽 represents the power of the test.
Tails of a test A two-tailed test has the rejection region in both tails of the distribution curve. A left-tailed test has the rejection region in the left tail of the distribution curve. A right-tailed test has the rejection region in the right tail of the distribution curve. Signs in 𝑯𝟎 and 𝑯𝟏 and tails of a test Sign in the hypothesis, 𝐻0
Left-Tailed Test
Right-Tailed Test
or
or
In both tails
In the left tail
In the right tail
Is equal to Is the same as Has not changed from Is the same as
Is not equal to Is different from Has changed from Is not the same as
null
Sign in the alternative hypothesis, 𝐻1 Rejection region
Two-tailed Test
Hypothesis Testing Common Phrases Is greater than Is above Is higher than Is longer than Is bigger than Is increased
Is less than Is below Is lower than Is shorter than Is smaller than Is decreased or reduced from
Example 1 State the null and alternative hypotheses for each of the following statement. Determine if each is a case of a two-tailed, a right tailed or a left tailed test. (a) Test if the mean number of hours spent working per week by college students who hold jobs is different from 20 hours. (b) Test whether or not a bank’s ATM is out of service for an average of more than 10 hours per month. (c) Test if the mean credit card debt of college seniors is less than RM 1000.
2
STA408
3.1
Chapter 3: Hypothesis Testing
Hypothesis Test of One Population Mean
Two approaches for hypothesis tests 1.
The 𝑝-value approach
Calculate probability or 𝑝-value for the observed value of the sample statistic. (obtained the 𝑝-value from the Minitab output) Compare the 𝑝-value with the significance level, 𝛼 and make a decision. Decision making: - Reject 𝐻0 if 𝑝-value ≤ 𝛼. - Do not reject 𝐻0 if 𝑝-value > 𝛼.
2.
The critical value approach
Find the critical value(s) from a table (normal distribution or t distribution table). Find the value of the test statistic for the observed value of the sample. (the value is either calculated or obtained from the Minitab output) Compare the test statistic (either from Minitab output or calculated, i.e., 𝑧calc or 𝑡calc) with the critical value(s) and make a decision. Decision making
Type of Distribution -
𝜎 2 known
Type of Test Two-tailed test
normal
-
large sample size (approximated by CLT)
Right-tailed test
𝜎 2 unknown
Two-tailed test
-
-
normally distributed with small sample size large sample size (approximated by CLT)
Test statistic
Reject 𝐻0 if 𝑧calc ≥ 𝑧𝛼
2
or 𝑧calc ≤ −𝑧𝛼 . 2
-
-
Decision
Left-tailed test
Reject 𝐻0 if 𝑧calc ≥ 𝑧𝛼 .
Left-tailed test
test statistic − mean standard error
𝑡calc =
test statistic − mean standard error
Reject 𝐻0 if 𝑧calc ≤ −𝑧𝛼 . Reject 𝐻0 if 𝑡calc ≥ 𝑡𝛼 ,𝜈
or 𝑡calc ≤ −𝑡𝛼 ,𝜈 .
2
2
Right-tailed test
𝑧calc =
Reject 𝐻0 if 𝑡calc ≥ 𝑡𝛼,𝜈
Reject 𝐻0 if 𝑡calc ≤ −𝑡𝛼,𝜈
Steps to perform a test of hypothesis: Step 1: State the null and alternative hypotheses.
Null Hypothesis Alternative Hypothesis
Two-Tailed Test
Right-Tailed Test
Left-Tailed Test
𝐻1 : 𝜇 ≠ 𝜇0
𝐻1 : 𝜇 > 𝜇0
𝐻1 : 𝜇 < 𝜇0
3
𝐻0 : 𝜇 = 𝜇0
STA408
Chapter 3: Hypothesis Testing
Step 2: Assume that 𝐻0 is true, state the distribution for the hypothesis test (optional).
Step 3: Determine the rejection region (or critical region) according to the given significance level, 𝛼. (can be based on 𝑝-value or critical value)
Step 4: State the 𝑝-value or test statistic from the Minitab output. Otherwise calculate the test statistic using the formula given, 𝑧calc = Step 5: Make comparison: -
test statistic − mean standard error
or
𝑡calc =
test statistic − mean standard error
Compare the 𝒑-value with the significance level, 𝛼; or
Compare the test statistic (either from Minitab output or calculated, i.e., 𝑧calc or 𝑡calc) with
the critical value(s). Step 6: Make a decision Step 7: Draw a conclusion.
Example 2 A telephone company provides long-distance telephone service in an area. According to the company’s records, the average length of all long-distance calls placed through this company in 2009 was 12.44 minutes. The company’s management wanted to check if the mean length of the current long-distance calls is different from 12.44 minutes. A sample of 150 such calls placed through this company produced a mean length of 13.71 minutes. The standard deviation of all such calls is 2.65 minutes. Using the 2% significance level, can you conclude that the mean length of all current long-distance calls is different from 12.44 minutes.
4
STA408
Chapter 3: Hypothesis Testing
Example 3 A researcher claims that the average cost of men’s athletic shoes is less than RM80. He selects at random a sample of 36 pairs of shoes from a catalogue and finds the following cost (rounded to the nearest RM). Is there enough evidence to support the researcher’s claim at 𝛼 = 0.10? Assume 𝜎 = 18.89. 60
50
120
110
75
110
70
40
90
65
60
85
75
80
75
80
90
45
55
70
85
85
90
90
80
50
80
85
60
70
55
95
60
45
95
70
5
STA408
Chapter 3: Hypothesis Testing
Example 4 The Minitab output for the data in Example 3 is as given below. Use 𝑝-value to test if the average cost of men’s athletic shoes is less than RM80 at 10% significance level. One-Sample Z: cost Test of μ = 80 vs < 80 The assumed standard deviation = 18.89 Variable cost
N 36
Mean 75.00
StDev 19.16
SE Mean 3.20
90% Upper Bound 79.10
Z -1.56
P 0.059
Example 5 A psychologist claims that the mean age at which children start walking is 12.5 months. Carol wanted to check if this claim is true. She took a random sample of 18 children and found that the mean age at which these children started walking was 12.9 months with a standard deviation of 0.80 month. It is known that the ages at which all children start walking are approximately normally distributed. Test that the mean age at which all children start walking is older than 12.5 months. What will your conclusion be if the significance level is 1%?
6
STA408
Chapter 3: Hypothesis Testing
Example 6 An educator claims that the average salary of substitute teachers in school is more than RM55 per day. A random sample of eight schools is selected, and the daily salaries (in RM) are shown. Is there enough evidence to support the educator’s claim at 𝛼 = 0.10? 60
56
60
55
70
55
60
55
Example 7 The Minitab output for the data in Example 6 is as given below. Use 𝑝-value to test if the average mean daily salary substitute teachers in school is more than RM55 per day. One-Sample T: salary Test of μ = 55 vs > 55 Variable salary
N 8
Mean 58.88
StDev 5.08
SE Mean 1.80
95% Lower Bound 55.47
7
T 2.16
P 0.034
STA408
3.2
Chapter 3: Hypothesis Testing
Hypothesis Test of Two Population Means
Hypothesis testing about 𝝁𝟏 − 𝝁𝟐 Null Hypothesis Alternative Hypothesis
Two-Tailed Test
Right-Tailed Test
Left-Tailed Test
𝐻1 : 𝜇1 − 𝜇2 ≠ 0
𝐻1 : 𝜇1 − 𝜇2 > 0
𝐻1 : 𝜇1 − 𝜇2 < 0
𝐻0 : 𝜇1 − 𝜇2 = 0
Test statistic In general, a test statistic for two population means is computed as follows: test statistic =
point estimate − population parameter standard error
Null Hypothesis
Test statistic 𝑧=
𝐻0 : 𝜇1 − 𝜇2 = 0
Variances 𝜎12 and 𝜎22 known
(𝑥1 − 𝑥2 ) − (𝜇1 − 𝜇2 )
𝑡calc = 𝐻0 : 𝜇1 − 𝜇2 = 0
Variances 𝜎12 = 𝜎22 and unknown
𝐻0 : 𝜇𝑑 = 0
𝑠𝑝 √
1 1 + 𝑛1 𝑛2
(𝑛1 − 1)𝑠12 + (𝑛2 − 1)𝑠22 𝑠𝑝 = √ 𝑛1 + 𝑛2 − 2
𝑡calc = Variances 𝜎12 ≠ 𝜎22 and unknown
(𝑥1 − 𝑥2 ) − (𝜇1 − 𝜇2 )
where
and
𝐻0 : 𝜇1 − 𝜇2 = 0
𝜎2 𝜎2 √ 1 + 2 𝑛1 𝑛2
𝜈 = 𝑛1 + 𝑛2 − 2
(𝑥1 − 𝑥2 ) − (𝜇1 − 𝜇2 ) 𝑠2 𝑠2 √ 1+ 2 𝑛1 𝑛2
and 𝜈=
𝑠2 𝑠 2 ( 1+ 2) 𝑛1 𝑛2 2
𝑑 − 𝜇𝑑 𝑠𝑑 √𝑛
𝜈 =𝑛−1
where 𝑛 is the number of pairs. 8
2
𝑠2 𝑠22 ) ( 1) ( 𝑛1 𝑛2 + 𝑛1 − 1 𝑛2 − 1
𝑡calc = and
2
STA408
Chapter 3: Hypothesis Testing
Example 8 (Example14 of Chapter 2) A survey of low-and middle-income households show that consumers aged 65 years and older had an average credit card debt of RM 10, 235 and consumers in the 50- to 64-year group had an average credit card debt of RM 9, 342 at the time of survey. Suppose that these averages where based on the random samples of 1200 and 1400 people for the two groups, respectively. Further, assume that the population standard deviations for the two groups were RM 2, 800 and RM 2, 500, respectively. Let 𝜇1 and 𝜇2 be the respective population means for the two groups, people ages 65 years and older and people in the 50- to 64- year age group. Test at 5% significance level whether the population means credit card debts for the two groups are different.
Example 9 A sample of 14 cans of Brand I diet soda gave a mean number of calories of 23 per can with a standard deviation of 3 calories. Another sample of 16 cans of Brand II diet soda gave the mean number of calories of 25 per can with a standard deviation of 4 calories. At the 1% significance level, can you conclude that the mean numbers of calories per can are different for these two brands of diet soda? Assume that the calories per can of diet soda are normally distributed for each of the two brands and that the standard deviations for the two populations are equal.
9
STA408
Chapter 3: Hypothesis Testing
Example 10 A company recently opened two supermarkets in two different areas. The management wants to know if the mean sales per day for these two supermarkets are different. The Minitab output for two-sample T-test and CI of the data on 10 days’ and 12 days’ daily sales (in thousand RM) for Supermarket A and B respectively are presented below.
Two-Sample T-Test and CI: Supermarket_A, Supermarket_B Two-sample T for Supermarket_A vs Supermarket_B Supermarket_A Supermarket_B
N 10 12
Mean 51.16 60.65
StDev 4.58 4.57
SE Mean 1.4 1.3
Difference = μ (Supermarket_A) - μ (Supermarket_B) Estimate for difference: -9.49 99% CI for difference: (-15.06, -3.92) T-Test of difference = 0 (vs ≠): T-Value = -4.85 P-Value = 0.000 Both use Pooled StDev = 4.5735
DF = 20
Assume the daily sales of the two supermarkets are both normally distributed. a) Show that the test statistic, 𝑡 = −4.85. b) State the null and alternative hypotheses for the above test. c) Based on the output, what is the assumption for the variances of the daily sales between the two supermarkets. Explain your answer. d) Using the p-value, do the data provide sufficient evidence to indicate that there is a significant difference in daily sales between the two supermarkets at 1% significant level? e) State the 99% confidence interval of the mean difference in daily sales between Supermarket A and Supermarket B? Does the interval further verify the conclusion in (d)? Support your answer.
10
STA408
Chapter 3: Hypothesis Testing
Example 11 Refer Example 9. Test at 1% significance level whether the mean number of calories per can of diet soda are different for these two brands. Assume that the calories per can of diet soda are normally distributed for each of these two brands and that the standard deviations for the two populations are not equal.
Example 12 Below is the Minitab output for two-sample T-test and CI for the 50 randomly selected 30-year fixed-rate mortgages and 45 randomly selected 20-year fixed-rate mortgages granted in a week. Two-Sample T-Test and CI: 30_year, 20_year Two-sample T for 30_year vs 20_year 30_year 20_year
N 50 45
Mean 5.434 5.298
StDev 0.467 0.417
SE Mean 0.066 0.062
Difference = μ (30_year) - μ (20_year) Estimate for difference: 0.1352 99% lower bound for difference: -0.0794 T-Test of difference = 0 (vs >): T-Value = 1.49
a) b)
P-Value = 0.070
DF = 92
Show that the test statistic, 𝑡 = 1.49. Test at 5% significance level whether the average rate on all 30-year fixed-rate mortgages was higher than the average rate on all 20-year fixed-rate mortgages granted in that week.
11
STA408
Chapter 3: Hypothesis Testing
Example 13 A company wanted to know if attending a course on “how to be a successful salesperson” can increase the average sales if its employees. The company sent six of its salespersons to attend this course. The table below gives the 1-week sales of these salespersons before and after they attended the course. Before
12
18
25
9
14
16
After
18
24
24
14
19
20
Using the 1% significance level, can you conclude that the mean weekly sales for all salespersons increase as a result of attending this course? Assume that the population of paired differences has a normal distribution.
Example 14 Below is the Minitab output of Example 13.
Paired T-Test and CI: Before, After Paired T for Before - After Before After Difference
N 6 6 6
Mean 15.67 19.83 -4.17
StDev 5.54 3.82 2.64
SE Mean 2.26 1.56 1.08
1% upper bound for mean difference: -7.79 T-Test of mean difference = 0 (vs < 0): T-Value = -3.87
P-Value = 0.006
Note: Whether the hypothesis testing is tested using test statistic or 𝑝 -value, the decision and conclusion of the test remain the same. In Example 13, the test was conducted using test statistic and 𝐻0 was rejected. Similarly in Example 14, 𝐻0 is rejected because 𝑝-value = 0.006 < 𝛼 = 0.01. 12
STA408
3.3
Chapter 3: Hypothesis Testing
𝝌𝟐 Test for a Variance or Standard Deviation
Null Hypothesis Alternative Hypothesis
Two-Tailed Test
Right-Tailed Test
Left-Tailed Test
𝐻1 : 𝜎 2 ≠ 𝜎02
𝐻1 : 𝜎 2 > 𝜎02
𝐻1 : 𝜎 2 < 𝜎02
Test statistic where the degrees of freedom is 𝑛 − 1.
2 𝜒calc =
𝐻0 : 𝜎 2 = 𝜎02
(𝑛 − 1)𝑠 2 𝜎02
Assumptions for the Chi-square Test for a Single Variance The sample must be randomly selected from a population. The population must be normally distributed for the variable under study. The observations must be independent of one another.
Example 15 An instructor wishes to see whether the variation in scores of the 23 students in her class is less than the variance of the population. The variance of the class is 198. Is there enough evidence to support the claim that the variation of the students is less than the population variance (𝜎 2 = 225) at 𝛼 = 0.05? Assume that the scores are normally distributed.
13
STA408
Chapter 3: Hypothesis Testing
Example 16 A hospital administrator believes that the standard deviation of the number of people using outpatient surgery per day is greater than 8. A random sample of 15 days is selected. The data are shown. At 𝛼 = 0.10, is there enough evidence to support the administrator’s claim? Assume the variable is normally distributed. 25
30
5
15
18
42
16
10
12
12
38
8
14
27
9
Example 17 Below is the Minitab output for the data in Example 16. Using 𝑝-value, test the administrator’s claim at 𝛼 = 0.10. Test and CI for One Variance: No_of_patient Method Null hypothesis Alternative hypothesis
σ = 8 σ > 8
The chi-square method is only for the normal distribution. The Bonett method is for any continuous distribution. Statistics Variable No_of_patient
N 15
StDev 11.2
Variance 125
90% One-Sided Confidence Intervals
Variable No_of...